
#Phpstorm cli interpreter code#
To test XDebug in the CLI/PHPUnit environment, open a runnable PHP file (unit test or CLI command), set a breakpoint in your code and choose "Debug" from its context menu. Go to the web site and see if the execution stops at the breakpoint. To test XDebug in the server environment, start the environment on the command line and add a breakpoint in your code.
Use the following configurations: Server:and then + Next select: Add a new CLI interpreter from Docker, vagrant.

After you created it, make sure that the path mapping is correct, check "Use Composer autoloader" and check if the "Path to script" points to the path-mapped autoloader file.Īlso check the "Default configuration file" and use the path /usr/share/nginx/Testing the PHPStorm setupįirst, choose "Run -> Start Listening to XDebug Connections" from the PHPStorm menu. Step3: Config PHPStorm Choose your php version Choose your php version Chick the three dot button on the line of CLI Interpreter You will see this pop up window CLI Interpreters Click. Set Up CLI interpreter Add a new CLI interpreter: In PhpStorm, go to File > Settings > Languages & Frameworks > PHP Click.
#Phpstorm cli interpreter plus#
Click the plus sign in the upper left corner to create a new PHPUnit configuration. In the PHPStorm preferences, go to "Languages & Frameworks -> PHP -> Testing Framework". PHP Storm shows 'Connection successful' Step 2: create new remote PHP CLI interpreter (Languages & frameworks -> PHP -> CLI interpreters ->. Map your local path to /usr/share/nginx/Add PHPUnit configuration Click the plus sign in the upper left corner to create a new server.Įnter as the server name, 8082 as the port and check the "Use Path mappings" box.
#Phpstorm cli interpreter how to#
In the PHPStorm preferences, go to "Languages & Frameworks -> PHP -> Server". In case somebody stumbles on this looking for how to set up PhpStorm tools that are installed within WSL/WSL2, this JetBrains issue thread helped me. You need to add the server name you configured in PHP_IDE_CONFIG the NGinX configuration. To switch between environments you can add another interpreter that uses docker-compose.yml without. Click on the three dots and enter xdebug.remote_host as name and your IP address as value. To get around the bugs of PHPStorm overriding the XDEBUG_CONFIG setting and PHPStorm not setting environment variables, you need to add a custom configuration setting in the "Configuration options".

For the example project it's app_debug.Īfter you clicked "OK", the interpreter will show up in the list of interpreters. After that, you can choose the container name with XDebug in it. In the PhpStorm preferences, select the PHP interpreter PhpStorm should use to run tests with. Click on the three dots for "Configuration file(s)" and add the file. Click on the plus sign in the upper left to add a new remote interpreter. Click on the three dots for the "CLI interpreter".Ī dialog with the configured interpreters will pop up. In the PHPStorm preferences, go to "Languages & Frameworks -> PHP". In particular, make sure that you have selected the default PHP Interpreter. In the "Plugins" section of the PHPStorm preferences make sure that you have installed the following Plugins:
