I import two different projects to PhpStorm. After that, like always I need to switch PHP version for project from 5.3 to 5.5. After doing this I saved project.
When I reopen this project I see that PhpStorm don't save this setting. I do this same operation again. But again, after reopen project I need to set proper version for project.
I check xml files in .idea
folder and php version is there set to 5.5.0 . I check project.default.xml
and there php version is set to 5.5.0 too.
I reinstall PhpStorm using JetBrains Toolbox but this doesn't change anything.
My OS is Ubuntu 14.04 . My project files are in my /home
folder and user/group of this is www-data/www-data
. My user is in group root/www-data/pmucha
. There is no problem with edit files (no permission problem).
I use latest version 2017.3.5 of PhpStorm.
I can't find solution to this problem. Can someone help me ?
I'm really tired of setting PHP version every time I open project or start new one.
Do you have composer.json in these projects? Most likely yes.
Thing is: PhpStorm by default synchronizes some settings from composer.json file. It can sync your PHP Language Level as well as Source & Test roots.
Right now it looks like PHP version defined in composer.json is 5.3 or lower (5.3 is the lowest in PhpStorm) .. so PhpStorm resets your manually configured version to the provided one by composer.json. Such sync usually happens on project opening .. hence the feeling that IDE does not remember the settings.
https://blog.jetbrains.com/phpstorm/2017/07/configuring-with-composer-in-phpstorm-2017-2/
Two possible solutions:
Either put a proper minimal PHP version into your composer.json (if you are writing your code using PHP 5.5 features .. so what's the point stating the 5.3 as lowest supported -- such code will fail if run using 5.3).
For example (small part of composer.json
):
"require": {
"php": ">=5.5",
...
}
Or disable such synchronisation at Settings/Preferences | Languages & Frameworks | PHP | Composer --> Synchronize IDE settings with composer.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With