Windows hostUbuntu\Linux remote virtual server (VMWare)PHPStorm
sudo apt-get install php5-xdebug
Find your php configuration file or your Xdebug configuration file.
Default location is in/etc/php5/apache2/php.ini
To find the config files :
find / -name 'php.ini' 2> /dev/nullfind / -name 'xdebug.ini' 2> /dev/null
Sometimes there are .ini files in
/etc/php5/apache2/conf.d/
These are more important and you would want to modify these.
In my case they look like20-xdebug.iniand20-php.ini
If you have these files follow Case II.
Add the following lines to the end of the php.ini file
[XDebug]zend_extension=XDEBUG_LIBRARY_PATHxdebug.default_enable = 1xdebug.idekey = "PHPSTORM"xdebug.remote_enable = 1xdebug.remote_autostart = 0xdebug.remote_port = 9000xdebug.remote_handler=dbgpxdebug.remote_log="/var/log/xdebug/xdebug.log"xdebug.remote_host=WINDOWS_LOCAL_IP
Replace XDEBUG_LIBRARY_PATH with path found by
find / -name 'xdebug.so' 2> /dev/null
Replace WINDOWS_LOCAL_IP with your windows local ip (cmdipconfig).
Only follow this path if you have a diffrent
xdebug.inifile
Open yourxdebug.inifile and add :
zend_extension=XDEBUG_LIBRARY_PATHxdebug.default_enable = 1xdebug.idekey = "PHPSTORM"xdebug.remote_enable = 1xdebug.remote_autostart = 0xdebug.remote_port = 9000xdebug.remote_handler=dbgpxdebug.remote_log="/var/log/xdebug/xdebug.log"xdebug.remote_host=WINDOWS_LOCAL_IP
Replace XDEBUG_LIBRARY_PATH with path found by
find / -name 'xdebug.so' 2> /dev/null
Replace WINDOWS_LOCAL_IP with your windows local ip (cmdipconfig).
sudo service apache2 restart
- Open up your PHPStorm project
- Install Google Chrome extension
- Activate debug session from extension
- Activate Start Listening for PHP Debug Connections from the Run menu
- Set a breakpoint
- Navigate to the respective page
- The debugger should pop in
If your local ip changes, you'll have to set it again in the config file.