30-04-2021



  1. Mac Phpstorm Xdebug Not Working
  2. Phpstorm Mac Debugger
Mac phpstorm xdebug not working

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:

Before upgrading my macbook to El Capitan I had a sweet setup of Phpstorm 9, php 5.6 (via homebrew), xdebug (via homebrew). For the last month or so, however, I have been breakin my head, trying to. How to configure XDebug for PhpStorm? Open PhpStorm - File - Default Settings - In the search box search with ‘debug’ Change ‘Debug port’ to 9001, apply and ok. Open File - Default Settings - Search for ‘IDE Key’.

  • 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

  • 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.

Terminate a debugger session

  • 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).

XDebug 3 only started working out of the box with PhpStorm version 2020.3

Reference article - Configure Xdebug

The list of changes from XDebug 2 to 3 are available here for reference - Upgrade Guide

Configuring PhpStorm

Go to PhpStorm -> Settings -> Languages & Frameworks -> PHP -> Servers

Mac Phpstorm Xdebug Not Working

  1. Click '+'
  2. Name docker-cli (Same as serverName under PHP_IDE_CONFIG environment variable)
  3. Host _
  4. Default 80
  5. Debugger Xdebug
  6. Check the checkbox next to 'Use path mappings'
  7. Modify the absolute path on the server to /var/www/html

Running the CLI Command

  1. Add breakpoints file
  2. In PhpStorm click the icon to 'Start Listening for PHP Debug connections'
  3. Run in the docker file - docker-compose run php-container php test.php

Troubleshooting

Phpstorm Mac Debugger

  1. Check firewall or selinux if on linux
  2. The configuration host.docker.internal only became available under Mac and Windows with Docker version 20.04