PHP built in functions/classes etc. are not recognized Follow
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.
Please sign in to leave a comment.
Hello, I have this same problem.
Phpstorm is complaining that is_numeric is an unknown/undefined function.
I have gone to "Settings/Languages & Frameworks/PHP/PHP Runtime/Sync Extensions with Interpreter." but this doesn't fix it.
I have coding for PHP 7.2 and have pointed the CLI interpreter to a PHP 7.2 executable. What else can I do?
Thank you
Elliot, could you please show the context? I just tried "is_numeric" function on a simple example in PhpStorm and no warnings are shown. Moreover, autocomplete is working for it.
It happened to me after running an update. David's method cleared it up.
Please try disabling all custom plugins at Settings | Plugins > click on a gear icon > "Disable All Downloaded Plugins", restart IDE and check the issue after that.
I've tried disabling all plugins with built-in, cache clear, removing idea project dir. No luck!
No luck. But I've just left my PC for few minutes and it works! Some background process...
Same here :(
IntelliJ IDEA 2020.1.4 (Ultimate Edition)
Build #IU-201.8743.12, built on July 21, 2020
Runtime version: 11.0.7+10-b765.65 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.6
GC: ParNew, ConcurrentMarkSweep
Memory: 1981M
Cores: 8
Registry: suggest.all.run.configurations.from.context=true
Non-Bundled Plugins: Dart, io.flutter, Pythonid, com.jetbrains.php
Same issue after updating to 2020.2. I tried to delete all plugins folders as you mentioned, delete .idea file of my project, restore default settings, reinstall PHPStorm... None of these solutions work.
Edit: The solution proposed by Arjan Frans temporarily solves the problem, thanks.
Arjan Frans thank you that actually helped!
Dmitry Tronin my PHPStorm is installed as a standalone app and "Core" PHP runtime is enabled. FYI, the solution proposed by Arjan Frans solves the problem.
PhpStorm 2020.2
Build #PS-202.6397.115, built on July 29, 2020
Licensed to La Coopérative des Tilleuls / Baptiste Meyer
You have a perpetual fallback license for this version
Subscription is active until July 30, 2021
Runtime version: 11.0.7+10-b944.20 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.5
GC: ParNew, ConcurrentMarkSweep
Memory: 4062M
Cores: 4
Registry: run.processes.with.pty=TRUE
Thanks for the info, but it's still not clear how did it happen. If anyone affected could share their logs via Help > Collect Logs and Diagnostic Data with us that would be great.
Dmitry Tronin https://we.tl/t-UhQnZJ13Jn
Thanks, downloaded.
Logs are looking alright.
Could you please:
1) attach a screenshot of File | Settings | Languages & Frameworks | PHP > PHP Runtime > Core
2) share your project's /.idea folder
.idea folder: https://we.tl/t-zjXY6i6gUg
Thanks. Do you have this problem in one particular project? What if you create an empty project - would the problem reoccur there?
Hello !
I've got the same problem, tried everything said above.
It happens in every projects (i even tried to create an empty project as you mentioned, same problem)
I just created a new project and the problem reoccurs. Sorry :(
e.g.
I see you've tried to reinstall the app: how exactly did you do this? Did you remove the app entirely with sudo rm -rf /Applications/PhpStorm.app?
I did this:
rm -rf /Applications/PhpStorm.app/
rm -rf ~/Library/Application\ Support/JetBrains/
rm -rf ~/Library/Application\ Support/PhpStorm*
rm -rf ~/Library/Caches/JetBrains/
rm -rf ~/Library/Caches/PhpStorm*
rm -rf ~/Projects/my-project/.idea
But maybe I forgot something because if I remember correctly my previous settings (theme, font, IDE sync, etc) always seemed to be there. I had to reset PHPStorm to default settings after reinstalling.
Please check the following:
1) Do you have PHP Runtime node under your Project view?
2) please check that you have a php.jar file at your IDE installation location. On Mac it's /Applications/PhpStorm.app/Contents/plugins/php/lib/. The file is 31,9MB as seen on a screenshot.
Everything looks good on this side:
Thanks! Notice there are no arrows against folders on your screenshot. It means that IDE is having troubles opening those files.
The ls -la output also differs a bit: php.jar on your installation has extended attributes. Please try removing them with xattr -c /Applications/PhpStorm.app/Contents/plugins/php/lib/php.jar
I removed the extended attributes but nothing changes. Even after restarting PHPStorm.
Could you please check if you can open the php.jar with "Archive Utility" app and browse it?
It works fine:
If anyone still has the issue and did not clear up the caches manually, please archive the
idea.system.path
folder, theidea.config.path
folder, collect the logs (Help | Collect Logs and Diagnostic Data) and upload all of this here sharing the upload ID.We need something we can reproduce the issue with badly. Thank you so much!
I have exactly the same issue. I am on Ubuntu with PHPStorm installed via Snap. Only project libraries are recognized. Functions like substr are all unavailable. Tried invalidate caches and some other suggestions, didn't work.
Maybe this helps: when I go to the composer tab in my settings, I see an endless spinner below the composer path. I am also sure this was not the case before the update. As a consequence, I cannot press the apply button and my changes are not taken into account. These things could be linked? Composer is also about external libraries.
Guys, we have one more question, as we cannot figure out what caused the issue.
Did any of you manage to solve the problem by simply removing the caches folder, without re-installing PhpStorm?