
In the Settings panel, expand and locate the Languages & Frameworks > PHP > Servers section.Ĭlick the + to add a server configuration.
#Phpstorm xdebug mac os
#Phpstorm xdebug pro
When deployed to Starter environments and Pro Integration environments, Xdebug is now available. On your local workstation, change to your Cloud project directory. To get started with environment branches:

To add Xdebug, we recommend creating a branch to work in and add the files. To configure Xdebug, you need to do the following:įor configuring on Pro plan Staging and Production, you need to enter a ticket for Staging and Production. You can locate the information through the Project Web Interface or your Cloud Onboarding UI. To run and use Xdebug, you need the SSH URL for the environment. For Pro Staging and Production environments, we include additional instructions for Xdebug.
#Phpstorm xdebug code
You need to pull code to your local development environment to perform debugging. Remember, all Adobe Commerce on cloud infrastructure environments are read-only. Once configured, you can debug CLI commands, web requests, and code. To push these settings to Pro plan Staging and Production environments, you must enter a ticket. After editing, you can push the Git changes across all Starter environments and Pro Integration environments to enable Xdebug. To set up Xdebug, you need to configure a file in your Git repository, configure your IDE, and set up port forwarding. You can configure Xdebug to run in the Cloud Docker for Commerce environment for local debugging without changing your Adobe Commerce on cloud infrastructure project configuration. See the vendor documentation for those applications for further configuration information.
#Phpstorm xdebug how to
The following explains how to configure Xdebug and PhpStorm to debug in your local environment. Xdebug is an extension for debugging your PHP.

Next you can either set a breakpoint (by clicking on the left side of a line) or break at the first line: Once set, you’re ready to debug! First start listening for debugging connections on the top right: For my repository and Vagrant this would be: Check the Use path mappings checkbox and map the paths. If you’re following along with the mtricht/xdebug-example repository from GitHub, for Vagrant this would be host 127.0.0.1 and port 8001.

Add a new server pointing to the publicly accessible host and port. Open the settings window and browse to Languages & Frameworks > PHP > Servers. Withouth the path mapping PhpStorm wouldn’t debug anything because the file paths wouldn’t match. If you’re running things in Docker or Vagrant, you need to setup the path mapping first. If you’re running your PHP code locally, there’s no need to configure anything in PhpStorm. Once you’re done configuring, restart apache, nginx, php-fpm or whatever you use and lets start debugging! Using it in PhpStorm By default this is localhost but for Docker you need the default gateway which is aliased to or for Vagrant 10.0.2.2. With xdebug.remote_host you tell Xdebug to connect to a certain host when debugging. If you’re following this guide whilst your application runs in Docker or Vagrant, you’ll need to include the xdebug.remote_host configuration. With this enabled you don’t have to set any HTTP header or command line flag. Normally you’d have to set a certain HTTP header when doing a HTTP request or add a certain PHP command line flag to your php command from the terminal. With xdebug.remote_autostart Xdebug will try to automatically debug every time you run anything in PHP. With xdebug.remote_enable we enable the debugging features of Xdebug to be debugged from a remote location. The path might be different for you depending on how you installed it. This is because certain Xdebug features, such as step debugging, require zend.

If you’ve installed PHP extensions before, you may be wondering why you have enabled other extensions with just extension=x.so. With zend_extension we load the PHP extension we installed. Zend_extension = /usr/lib64/php/modules/xdebug.so xdebug.remote_enable = 1 xdebug.remote_autostart = 1
