

Add the remote session parameters to php.ini If you setup you MAMP PHP globally you can also do:Īnd find your php.ini path. Your php ini file will be in: /Applications/MAMP/bin/php/php5.5.3/conf/php.ini /Applications/MAMP/bin/php/YOUR_PHP_VERSION/conf/php.ini Php -v Check your PHP version in terminal bash_profile: # MAMP PHPĮxport MAMP_PHP=/Applications/MAMP/bin/php/php5.5.3/bin bash_proile doesn’t exist touch ~/.bash_profile open ~/.bash_profileĮnter the following at the bottom of your. Set your PHP version globally (optional)Įither create or open your. Find Your PHP version in MAMP Find your PHP version in MAMP 2. You should be able to copy paste all commands. Note I will be doing most work from the terminal. There are plenty of steps to do in order to get this to work.

Here is how those two options look like in PhpStorm: Xdebug PhpStorm Direct vs Remote
PHPSTORM XDEBUG REMOTE CODE
The second method is the remote debugging where anywhere in you code you set a break point and essentially trigger the debugging remotely, in our case a browser. So you need to know exactly where to start and all files you want to debug need to be somehow connected (told you I am no expert on this…). The first one essentially is essentially like running php from your command line using Xdebug.

Essentially you can find two types of debugging. If anybody knows the proper terminology, please leave them in the comments and I am more than happy to change this. I am no expert on this topic, so apologize my language. YouTube Video Xdebug, PhpStorm and MAMP – OSX – Setup GuideĪs seen on: | Link to YouTube | Subscribe to my channel Two different types of Xdebug modes In our case I am interested to debug WordPress Themes and Plugins without having to declare what file to start from. Our goal here is to get remote debugging setup to be able to debug any line within a much bigger web app. I: Connecting to configured address/port: localhost:9009.Very excited to present my own Setup Guide to get Xdebug, PhpStorm and MAMP to play nice together. XDebug says the connection is successful: Log opened at 05:31:10 PHPStorm validates the settings (remember localhost is used because the port is tunnelled):īut I get this error when trying to run the debugger:

XDebug's remote log says the connection was successful, but PHPStorm thinks otherwise. It validates the setup as all being OK, and can "see" the XDebug server. However, PHPStorm refuses to admit it can connect to XDebug. In theory this seems to work requests are being tunnelled between my local machine and the project server, all via the "middle" machine's proxy. I tunnel from my local machine to SSH port 22 on the remote server (via port 2222 locally), and I tunnel from the remote server to port 9009 on my local machine where the PHPStorm XDebug client listens. This part isn't a problem I connect via PuTTY using it's Proxy setting, and then I have set up port tunnels for communication with XDebug between my local machine and the project server. The remote server is firewalled and only accepts connections from a second remote server, so in order to connect to the project server I need to connect via an SSH proxy. I need to use XDebug for a remotely-hosted PHP project.
