Essential Articles on Remote PHP Debugging with PHPStorm and Xdebug

Steps:

 

Enable remote xdebug in php.ini 

you will add a line in php.ini

xdebug.remote_enable=1

Test your connection, if it doesn’t work with localhost, try you local network IP address as it depends to which network adapter PHPStorm is using for the debugging purposes.

 

Mac-Pro:~ mac$ telnet localhost 9000

Trying ::1…

telnet: connect to address ::1: Connection refused

Trying 127.0.0.1…

Connected to localhost.

Escape character is ‘^]’.

^\^]

telnet> exit

?Invalid command

telnet> quit

Connection closed.

Mac-Pro:~ mac$ telnet 192.168.1.8 9000

Trying 192.168.1.8…

Connected to 192.168.1.8.

Escape character is ‘^]’.

 

 

http://randyfay.com/content/remote-drupalphp-debugging-xdebug-and-phpstorm

http://randyfay.com/content/remote-command-line-debugging-phpstorm-phpdrupal-including-drush

php5 nginx xdebug


$ sudo apt-get install php5-dev php-pear
$ sudo pecl install xdebug

Open file /etc/php5/fpm/php.ini 

$ sudo nano /etc/php5/fpm/php.ini

 add the following line to the “Dynamic Extensions” section:

[xdebug]
zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_port=9000
xdebug.remote_enable=On
xdebug.remote_connect_back=On
xdebug.remote_log=/var/log/xdebug.log

Restart PHP:

$ sudo service php5-fpm restart 

 

http://blog.shahariaazam.com/enable-xdebug-in-nginx/#.VKY8wGZdksk

http://www.bravo-kernel.com/2014/09/how-to-set-up-xdebug-for-php5-fpm-on-ubuntu/

Enable xDebug MAMP Pro Mac OSX PHPStorm

WARNING: Do not edit the php.ini files manually. If you try to edit your files with Finder your changes to php.ini will not be applied.

First, are you using MAMP (free) or MAMP Pro

Turns out there is a difference between the php.ini file you edit from MAMP and the php.ini file that PhpStorm uses in the interpreter.

The MAMP Pro php.ini file resides in /Library/Application Support/appsolute/MAMP PRO/conf/php.ini and doesn’t have a PHP installation (which PhpStorm needs when setting the interpreter). If you run phpinfo(); this is the file you will see data from.

When you set PhpStorm to the necessary location here /Applications/MAMP/bin/php/php5.4.x/bin it looks at the php.ini file there, not the one that MAMP Pro uses (above). So if you want PhpStorm to see the debugger, you need to add the code to that php.ini file.

 

STEPS:

With MAMP Pro open, go to  File-> Edit Template -> PHP -> Choose the appropriate PHP Version

Now, locate the extensions section of the php.ini file

Add the following line:

zend_extension=xdebug.so

When you’re done, your extensions section should look like something like this (bolded line for emphasis).

; Extensions

MAMP_apc_MAMP

extension=imap.so

extension=gettext.so

extension=mcrypt.so

extension=yaz.so

extension=pgsql.so

extension=pdo_pgsql.so

extension=pdo_mysql.so

extension=imagick.so

extension=tidy.so
zend_extension=xdebug.so

Close the php.ini Edit Template window. MAMP Pro will prompt to restart server, choose Yes.

 

Important to use the ‘zend_extension’ prefix.

Before sure to make the same changes in php.ini located in the Applications/ folder (substitute the php version number for the version you are using).

/Applications/MAMP/bin/php/php5.5.10/conf/php.ini

 

This configuration will work with PHPStorm.

Restart PHPStorm. Restart your browser.

 Try xDebug it will work.

zend_extension