Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rvaliev/64c14004c03aa6fe96186d83e9146aba to your computer and use it in GitHub Desktop.
Save rvaliev/64c14004c03aa6fe96186d83e9146aba to your computer and use it in GitHub Desktop.
Nginx with PHP7-FPM and XDebug

##Install PHP7

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0-fpm php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-phpdbg php7.0-mbstring php7.0-gd php7.0-imap php7.0-ldap php7.0-pgsql php7.0-pspell php7.0-recode php7.0-snmp php7.0-tidy php7.0-dev php7.0-intl php7.0-gd php7.0-curl php7.0-zip php7.0-xml

##Change PHP socket to

/var/run/php/php7.0-fpm.sock

Source: https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-ubuntu-14-04

Paste your phpinfo() to http://xdebug.org/wizard.php and follow the installation steps

Create file xdebug.ini to /etc/php/mods-available and paste the following:

zend_extension = xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.var_display_max_depth = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1
xdebug.idekey = "PHPSTORM"

Then sudo ln -s /etc/php/mods-available/xdebug.ini /etc/php/7.0/fpm/conf.d/20-xdebug.ini

All done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment