PHP built in functions/classes etc. are not recognized

After a restart of PhpStorm it started to highlight all built in classes (e.g. \Exception) as undefined and it also doesn't hint php built in functions (e.g. \trim, \strtolower) while typing. It looks like it suddenly doesn't know native php :-) What settings should I check to make everything work again?

Thank you.


I tried this solution again and... it works:

However, I have already run this command earlier, I can see it in my bash history. I think my error was deleting the cache and then reinstalling PHPStorm. The correct manipulation would be to install PHPStorm/the update, delete the cache and restart PHPStorm.


So here is the fix:

on Linux, execute this command: rm -rf ~/.cache/JetBrains/PhpStorm2020.2/

on macOs: rm -rf ~/Library/Caches/JetBrains/PhpStorm2020.2/

Then restart PHPStorm.


I encountered the same problem, where native classes and functions were not being recognized by PhpStorm (2019.1.2).

It appears something in the cache/indexing was corrupted as I couldn't pull up any quick documentation on it, nor could I navigate (Ctrl + click) to the definition... No obvious cause found...

The solution for me was to invalidate my cache (File->Invalidate Caches / Restart)

After re-indexing and re-caching it is working as expected now.


Same issue after updating to 2020.2


Disabling plugins and invalidating the cache didn't help.


As a workaround I found this solution:


1. Clone the stubs repository

2. Configure the default stubs path


I reinstalled PHPStorm with
and the issue was resolved


Same here. Invalidating caches didn't work, removing the Cache directory manually helped


I got the same bug after updating it to 2020.2


I have the same Issue since i updated.

PhpStorm 2020.2
Build #PS-202.6397.115, built on July 29, 2020
Licensed to active value GmbH / Chris Adam
Subscription is active until June 16, 2021
Runtime version: 11.0.7+10-b944.20 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.0.0-38-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 1917M
Cores: 12
Registry: run.processes.with.pty=TRUE, ide.balloon.shadow.size=0
Non-Bundled Plugins: com.chrisrm.idea.MaterialThemeUI, com.jensteichert.themes.nightowl, com.mallowigi, de.espend.idea.php.annotation, fr.adrienbrault.idea.symfony2plugin, izhangzhihao.rainbow.brackets
Current Desktop: ubuntu:GNOME


I have this issue too after update to PhpStorm 2020.2


PhpStorm 2020.2
Build #PS-202.6397.115, built on July 29, 2020
Runtime version: 11.0.7+10-b944.20 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1981M
Cores: 8
Registry: run.processes.with.pty=TRUE,
Non-Bundled Plugins: de.netnexus.camelcaseplugin, intellij.prettierJS, de.espend.idea.laravel, com.kalessil.phpStorm.phpInspectionsEA, de.espend.idea.php.annotation


The same happened today after snap update.

PhpStorm 2020.2
Build #PS-202.6397.115, built on July 29, 2020
Licensed to PhpStorm Evaluator
Expiration date: August 29, 2020
Runtime version: 11.0.7+10-b944.20 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.4.0-42-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 841M
Cores: 4
Registry: run.processes.with.pty=TRUE
Non-Bundled Plugins: com.aurimasniekis.phppsr4namespacedetector, ru.adelf.idea.dotenv
Current Desktop: ubuntu:GNOME


Baptiste's solution also worked for me on Windows, where simply invalidating the cache from within PhpStorm was not.


On Windows I deleted the files in:



Eugene Morozov yes.

"Invalidate caches and restart" failed to solve the problem. Executed `rm -rf ~/.cache/JetBrains/PhpStorm2020.2`, closed and reopened PhpStorm. That resolved the issue for me. I did not re-install PhpStorm.



It helped me: deleting ~/.cache/JetBrains/PhpStorm2020.2/ folder


Did you try to remove caches manually, right?



Had the same problems, and only

  • disabling some 3rd party plugins

helped. I had two new RDF related plugins installed ( Editor, RDF and SPARQL). After disabling them PHPStorm again recognized php standard functions etc.


Please try opening plugins directory and delete all plugin folders manually. and then restart IDE. If that doesn't help - please attach a screenshot of the problem + share your idea.log file. You can also contact us via Help | Contact Support to do this privately.


1) do you have PhpStorm installed via ToolBox app or a standalone app or via snap?

2) do you have "Core" PHP runtime enabled at File | Settings | Languages & Frameworks | PHP?


Thanks  Baptiste, this solution really worked.


Same here after update to version 2020.2. I have IDE installed via Toolbox.

Standard functions like is_array() are not recognized. I've invalidated cache, disabled plugins etc. I have checked all libs from PHP Runtime. Nothing worked.

Solution with manually removing cache worked. Thanks!


Folks, we have extracted issue reports to the YouTrack ticket:

Please feel free to follow and comment.


The same issues for me for all projects.
Clean cache doesnt help, reset ide doesnt help, new project doesnt help, delete .idea doesnt help, disable downloaded plugins doesnt help.

<link removed>

After closing phpstorm and then by manually deleting ~/Library/Caches/JetBrains and then relaunching PhpStorm it solved the issue.

Its on Mac.

Guys, we are paying a lot for licences - it isnt so hard to figure out the issue and provide fix.



Please make sure you've deleted ~/Library/Caches/JetBrains/PhpStorm2020.2/caches directory. Then restart PhpStorm & check the problem again.


rm -rf ~/Library/Caches/JetBrains/PhpStorm2020.2/

worked for me too. Invalidate Caches/Restart did not.

On a side note, I looked for the php.jar file and my contents looks pretty barren. It's installed with Toolbox. Is this normal?


Yep, that's right -- Invalidating Cache is clearly not enough to fix this issue and "caches" directory has to be removed manually.


Not yet.

Invalidating the cache and clearing /caches/* did the trick.

Still hope to get a a real fix in an upcoming release.


I had the same issue. It began, after i closed current project and tried to open another one. While it took a long time to open and looked like stuck i have killed PhpStorm process from task manager. After that i had that problem, that none of PHP functions were recognized.
Possibly, because i killed PhpStorm while opening project.

Invalidating Cache did not help.

Clearing /caches/ did the trick.

I hope it helps to fix it.


Did you try any of the solutions listed here? Specifically try deleting the caches directory in IDE system folder.


Had this issue today after upgrading to 2020.3.2 a few days ago from 2019 (found auto update in the toolbox).

Invalidating the cache did not work; had to manually delete the cache folder and give it a couple of minutes to re-index everything.

Running under Lubuntu.


I was looking for it for half an hour and of course, right after posting this question, I found it :)

"Settings/Languages & Frameworks/PHP/PHP Runtime/Sync Extensions with Interpreter."


Please sign in to leave a comment.