A local PHP interpreter is a PHP engine installed on your computer opposite to a remote PHP interpreter that can be installed on a remote host or in a virtual environment set up in a Vagrant instance, see Configure remote PHP interpreters.
Create an xdebug.ini file (must end by.ini ): # Navigate to the Devilbox git directory host cd path/to/devilbox # Navigate to PHP 5.6 ini configuration directory host cd cfg/php-ini-5.6/ # Create and open debug.ini file host vi xdebug.ini. Run/debug a php script on docker To verify that everything is working, open the file app/hello-world.php in PhpStorm, right click in the editor pane and choose 'Run'. PhpStorm will start the configured container and run the script. The output is then visible at the bottom of the IDE. Xdebug is a great way to eliminate vardump, printr statements and make your PHP debugging experience better and more productive. When you have a simple application there is not really need to spend time on configuring Xdebug, you can go along with dumping varialbes, however in such applications and frameworks like Magento it is really hard to debug using vardump statements. Depending on your environment, you can debug your PHP Web application locally or remotely. To test direct connection, run the telnet host 9000 (for Xdebug) or the telnet host 10137 (for Zend Debugger) command on the remote server and ensure that connection is established. Here, host is the IP address of the local machine PhpStorm is running on.
In the Settings/Preferences dialog Ctrl+Alt+S, go to PHP.
On the PHP page that opens, click next to the CLI Interpreter list.
In the CLI Interpreters dialog that opens, click in the left-hand pane, then choose Local from the popup menu.
If you already have a local interpreter configured in PhpStorm, it is also shown from the menu and the menu item changes to Other Local.
In the right-hand pane of the dialog, specify the PHP interpreter's settings.
In the Name field, type the identifier to distinguish the interpreter from others, for example,
php_installation_<version>
.Specify the PHP engine installation directory in the PHP executable field. Type the path manually or click and select the relevant folder in the dialog that opens.
PhpStorm displays the version of the PHP engine detected in the specified folder and the debugger associated with this PHP engine in the php.ini file.
In the Additional area of the CLI Interpreters dialog, you can optionally customize the configuration settings of the PHP installation.
In the Debugger extension field, specify the path to Xdebug. This enables PhpStorm to activate Xdebug when it is necessary if you have disabled it in the php.ini file, see Configuring Xdebug for Using in the On-Demand Mode.
In the Configuration options field, compose a string of configuration directives to be passed through the -d command line option and thus add new entries to the php.ini file. The directives specified in this field override the default directives generated by PhpStorm, such as
-dxdebug.remote_enable=1
,-dxdebug.remote_host=127.0.0.1
,-dxdebug.remote_port=9001
,-dxdebug.remote_mode=req
.For example, if you specify the
-dxdebug.remote_mode=jit
directive it will override the default-dxdebug.remote_mode=req
directive and thus switch Xdebug to the Just-In-Time (JIT) mode, see Debug in the Just-In-Time mode for details.To do that, click next to the Configuration options field, and then create a list of entries in the Configuration Options dialog that opens.
- To add a new entry, click . In the new line, that is added to the list, specify the name of the new entry and its value in the Name and Value fields respectively.
You can add as many entries as you need, just keep in mind that they will be transformed into a command line with its length limited to 256 characters.
To delete an entry, select it in the list and click .
To change the order of entries, click or .
Upon clicking OK, you return to the CLI Interpreters dialog, where the entries are transformed into a command line.
- To add a new entry, click . In the new line, that is added to the list, specify the name of the new entry and its value in the Name and Value fields respectively.
Click to have PhpStorm display a separate information window with the installation details and the list of loaded extensions and configured options. Note that the additional options specified in the Configuration Options field of the PHP Interpreters dialog are not listed.
Phpstorm Xdebug Docker
Switch between configured PHP interpreters on the fly
Press Ctrl+Shift+A and start typing
Change PHP interpreter
. In the suggestions list, select the Change PHP interpreter action.If necessary, you can assign a keyboard shortcut for this action either directly in the suggestions list by pressing Alt+Enter, or at a later point as described in Configure keyboard shortcuts.
In the popup menu that opens, select one of the configured local or remote PHP interpreters.
The selected interpreter will be set as the default project interpreter on the PHP page of the Settings/Preferences dialog Ctrl+Alt+S. This will also affect the run/debug configurations, test frameworks', and quality tools' configurations that are set to use the default project interpreter.
Before you start debugging, make sure that you have a debugging engine installed and configured properly. PhpStorm supports debugging with two most popular tools: Xdebug and Zend Debugger. These tools cannot be used simultaneously because they block each other. To avoid this problem, you need to update the corresponding sections in the php.ini file as described in Configure Xdebug and Configure Zend Debugger.
With PhpStorm, a PHP debugging session can be initiated either through a run/debug configuration or without it. The latter approach is also called Zero-configuration debugging. PhpStorm supports three main ways to initiate a PHP debugging session:
You create a PHP Web Page debug configuration, and then PhpStorm uses its settings to launch the application, open the browser, and activate the debugging engine.
You create a PHP HTTP Request debug configuration or an HTTP request in the code editor, PhpStorm generates a request on its base, and then accesses a specific page through this request.
Zero-configuration debugging, when no debug configuration is created at all. Instead, you open the starting page of your PHP application in the browser manually and then activate the debugging engine from the browser, while PhpStorm listens to incoming debugger connections.
No matter which method you choose, you can specify the scripts requests to which you want PhpStorm to ignore during debugging. This approach can be useful, when your application contains scripts that use AJAX. Suppose you have a menu-ajax-script.php that 'reloads' a part of your web page. This script works properly so you do not need to debug it. However, this script is still requested during the debugging session. To have incoming connections to this script ignored, add the menu-ajax-script.php script to the skipped paths list.
If a script is added to Skipped paths, it is only skipped when starting a debugging session for it. To ignore a script when stepping through the program during a debugging session, configure a stepping filter.
When using Xdebug, you can also debug PHP applications in the multiuser mode via Xdebug proxy servers.
Pause a debugging session
From the main menu, choose Run | Debugging Actions | Pause Program.
Click on the Debug toolbar.
This action is not available for Run/Debug Configuration: Attach to Node.js/Chrome.
Resume a debugging session
Phpstorm Xdebug Laravel Command
From the main menu, select Run | Debugging Actions | Resume Program.
Click in the Debug tool window or press F9.
Restart a debugger session
Click in the Debug tool window or press Ctrl+F5.
Phpstorm Xdebug Tutorial
Terminate a debugger session
Phpstorm Xdebug Mac Version
Click the in the Debug tool window. Alternatively, press Ctrl+F2 and select the process to terminate (if there are two or more of them).