Issue Summary
I would like to use the version of PHP tied to the site in LocalWP in PhpStorm as the CLI Interpreter for things like Composer and PHPUnit.
If I open the shell, run which php
, and then paste that URL into PhpStorm for the interpreter it almost works. It finds the executable alright, but it cannot find the corresponding ini file.
It seems like a symlink or something like that could resolve the issue.
System Details
Oh. Turns out it really was as simple as creating a symlink to the ini file where the php executable is located. Hahah!
Steps
Open up the shell for the site
Run which php
Copy that URL and paste it into PhpStorm for the executable path
Run php -i
in the terminal
At the top of the output, grab the ini configuration path
In a separate terminal (not in the Local shell) cd to the directory where the php file is located
Run ln -s /path/to/php.ini php.in
— using the php.ini path from above
1 Like
I don’t use PHPStorm, so forgive my ignorance!
Does PHPStorm store a project configuration file somewhere similar to how VS Code has a project config folder named .vscode
in the project root?
I’m guessing there is something like that and is what the Xdebug PHPStorm addon uses when adding the run configuration for PHPStorm.
@jasontheadams Have you tried using that addon to see if it’s basically doing the same thing that your shell wizardry is doing?
system
Closed
December 5, 2021, 7:13am
4
This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
@jasontheadams – messaged me since this topic closed after being solved:
I tried using that add-on on another install, but it doesn’t appear to have added a PHP Interpreter to PhpStorm.