Skip to content

Instantly share code, notes, and snippets.

@davidchchang
Last active February 3, 2016 16:11
Show Gist options
  • Select an option

  • Save davidchchang/e0294ff3c6dc3cf8c124 to your computer and use it in GitHub Desktop.

Select an option

Save davidchchang/e0294ff3c6dc3cf8c124 to your computer and use it in GitHub Desktop.
Setup xdebug to run on localhost with PhpStorm
// Run the following:
brew install php55-xdebug
// where 55 is the PHP version number (php -v) - in this case, PHP 5.5
// You may be required to change permissions before you can install php55:
sudo chown -R $USER:admin /usr/local
// where $USER is your local account
// Caveats:
To finish installing xdebug for PHP 5.5:
* /usr/local/etc/php/5.5/conf.d/ext-xdebug.ini was created,
do not forget to remove it upon extension removal.
* Validate installation via one of the following methods:
*
* Using PHP from a webserver:
* - Restart your webserver.
* - Write a PHP page that calls "phpinfo();"
* - Load it in a browser and look for the info on the xdebug module.
* - If you see it, you have been successful!
*
* Using PHP from the command line:
* - Run "php -i" (command-line "phpinfo()")
* - Look for the info on the xdebug module.
* - If you see it, you have been successful!
// In php.ini, set the following:
[xdebug]
zend_extension="/usr/local/opt/php55-xdebug/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
// Start PHP web server using configuration file:
php -S localhost:8001 -c php.ini
// Create bookmarklets: https://www.jetbrains.com/phpstorm/marklets/
// Setup debugger in PhpStorm: setup new PHP Remote Debug
// Set Ide key to be $USER or whatever it is in the phpinfo() output
// Start debugger in PhpStorm
// Start debugger in browser
// Refresh page
// from: https://confluence.jetbrains.com/display/PhpStorm/Xdebug+Installation+Guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment