Debugging with Xdebug

Setting Up Xdebug with MAMP Pro and PhpStorm

How to set up Xdebug with PhpStorm running a local server using MAMP Pro.

For this video we are going to learn how to set up Xde­bug with Php­Storm run­ning a local serv­er on MAMP Pro. Xde­bug runs via MAMP Pro, as a PHP exten­sion, so the first we need to do is enable Xde­bug in our MAMP Pro configuration. 

To enable Xde­bug in MAMP Pro, we need to access the PHP set­tings via the MAMP Pro app. 

  • First, we have to switch to Expert View to reveal some addi­tion­al settings. 
  • Next, choose PHP under Lan­guages in the sidebar. 
  • In the Exten­sions” sec­tion, we will check Xde­bug (Debug­ger)” to enable Xdebug. 
  • Click Save and then choose Yes” to have the servers restart­ed to the change is applied.

This enables Xde­bug so it is run­ning as a PHP exten­sion. Now it will be avail­able to call back to our IDE on port 9000 when it receives a HTTP request.

Php­Storm has a zero-con­fig­u­ra­tion fea­ture for Xde­bug and with MAMP Pro it seems to work nice­ly out-of-the-box, so you should be able to accept its set­tings and then con­tin­ue on with your setup.

Debugging with Xdebug is made up of the following videos: