PhpStorm 9.0.0 Help

Configuring Zend Debugger

Configuring the Zend Debugger tool involves:

Downloading and installing Zend Debugger

  1. Download the Zend Debugger package which corresponds to your operating system.
  2. Locate the ZendDebugger.so (Unix) or ZendDebugger.dll (Windows) file in the directory which corresponds to your version of PHP (e.g. 4.3.x, 4.4.x, 5.0.x, 5.1.x, 5.2.x, 5.3.x, 5.4.x).
  3. Copy the file to your Web server in a location that is accessible by the Web server.

Enabling Zend Debugger integration with the PHP engine

  1. Open the active php.ini file in the editor:
    1. Open the Settings dialog box by choosing File | Settings, then click PHP under Languages & Frameworks. The PHP page opens.
    2. Click browseButton.png next to the Interpreter field.
    3. In the Interpreters dialog box that opens, the Configuration File read-only field shows the path to the active php.ini file. Click Open in Editor.
  2. Locate or create the [Zend] section.
  3. To load the Zend Debugger extension, add one of the following lines inside the [Zend] section depending on your operating system:
    • Linux and OS X:
      zend_extension=<full_path_to_ZendDebugger.so>
    • Windows:
      zend_extension_ts=<full_path_to_ZendDebugger.dll>
    • Windows non-thread safe:
      zend_extension=<full_path_to_ZendDebugger.dll>
  4. To enable access to Zend Debugger from PhpStorm, add the following lines:
    zend_extension=<full_path_to_zend_debugger_extension> zend_debugger.allow_hosts=127.0.0.1 zend_debugger.expose_remotely=allowed_host zend_debugger.tunnel_min_port=<any integer value above 1024> zend_debugger.tunnel_max_port=<any integer value below 65535>

    The value of the zend_debugger.allow_hosts parameter is the IPs of your machine to connect to the server debugger. It could be a comma-separated list of IPs in the format X.X.X.X (for example, 192.168.0.6).

  5. Restart your Web server.
  6. To check that the Zend Debugger has been installed and configured correctly, create a file with the following contents:
    <?php phpinfo(); ?>
    Open the page that corresponds to the file in the browser. The output should contain a Zend Debugger section.

Integrating Zend Debugger with PhpStorm

  1. Open the Settings dialog box by choosing File | Settings, then click PHP under Languages & Frameworks. The PHP page opens.
  2. Check the Zend Debugger installation associated with the selected PHP interpreter:
    1. On the PHP page, choose the relevant PHP installation from the Interpreter drop-down list and click the Browse button browseButton next to the field. The list shows all the PHP installations available in PhpStorm, see Enabling PHP Support.
    2. The Interpreters dialog box that opens shows the following:
      • The version of the selected PHP installation.
      • The name and version of the debugging engine associated with the selected PHP installation (Xdebug or Zend Debugger). If no debugger is configured, PhpStorm shows Debugger: Not installed.

    Learn more about checking the Zend Debugger installation in Validating the Configuration of a Debugging Engine.

  3. Define the Zend Debugger behaviour. Click Debug under the PHP node. On the Debug page that opens, specify the following settings in the Zend Debugger area:
    • In the Debug Port text box, appoint the port for PhpStorm to communicate with the tool through. Type the port number within the tunnel specified in the php.ini file through zend_debugger.tunnel_min_port and zend_debugger.tunnel_max_port. For details, see http://files.zend.com/help/previous-version/Zend-Server-4-Community-Edition/zenddebugger.html
    • To have PhpStorm accept any incoming connections from Zend Debugger engines through the port specified in the Debug port text box, select the Can accept external connections check box.
    • To use a debugger toolbar in the browser, specify the port through which the debugger settings are passed to the browser in the Settings broadcasting port text box.
  4. To have Zend Debugger stop as soon as connection between it and PhpStorm is established (instead of running automatically until the first breakpoint is reached), turn on the Run | Break at first line in PHP scripts option on the main menu.
  5. To block requests from the Z-Ray system if they annoy you by invoking the PhpStorm debugger too often, select the Ignore Z-Ray system requests check box

See Also

Last modified: 2 July 2015