![]() This will ensure PhpStorm reacts when a debugging session is started and opens the debug tool window automatically. In PhpStorm, enable listening to incoming debug connections by either clicking on the toolbar or selecting Run | Start Listening for PHP Debug Connections. Listening for incoming debugger connections XDEBUG_CONFIG environment variable exists. Xdebug's remote_autostart (for Xdebug 2) or start_with_request (for Xdebug 3) option is enabled. Start a debugging session from the command lineīefore you start a debugging session with PhpStorm when running CLI scripts, make sure that any of the following requirements is met: This will also affect configurations that use the default project interpreter ( test frameworks', quality tools', and run/debug configurations) and commands run in the PhpStorm terminal. The selected interpreter will be set as the default project interpreter on the PHP page of the Settings dialog ( Ctrl+Alt+S). In the popup menu that opens, select one of the configured local or remote PHP interpreters. 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 suggestions list, select the Change PHP interpreter action. Press Ctrl+Shift+A and start typing Change PHP interpreter. We will need a Run/Debug configuration to start the debugger from within PhpStorm. A configuration can define additional arguments for the PHP interpreter as well as launch other commands prior to starting our script. PhpStorm uses Run/Debug configurations to execute a script from within the IDE. To start debugging a PHP CLI script from within PhpStorm, perform the following steps. In the CLI Interpreters dialog that opens, the Configuration file read-only field shows the path to the active php.ini file. On the PHP page that opens, click next to the CLI Interpreter field. In the Settings dialog ( Ctrl+Alt+S), click PHP. ![]() Open the active php.ini file in the editor: 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. These tools cannot be used simultaneously because they block each other. PhpStorm supports debugging with two most popular tools: Xdebug and Zend Debugger. We'll take a look at both options.īefore you start debugging, make sure that you have a debugging engine installed and configured properly. Alternatively, you can let PhpStorm listen for incoming debugger connections and start the script outside the IDE. You can start it from within PhpStorm and make it start the script and attach the debugger to it. There are several ways to start a PHP CLI debugging session. Various command line tools, daemons, message queue processing applications and other types of applications typically run in the PHP CLI. ![]() PHP applications are not always web applications.
0 Comments
Leave a Reply. |