- Ubuntu 16.04+
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt update
$ sudo apt install nginx php7.1-fpm php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-phpdbg php7.1-mbstring php7.1-gd php7.1-imap php7.1-ldap php7.1-pgsql php7.1-pspell php7.1-recode php7.1-soap php7.1-tidy php7.1-dev php7.1-intl php7.1-curl php7.1-zip php7.1-xml php-xdebug
- Centos 7.x / Fedora 25.x
$ sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
$ sudo yum/dnf install nginx php71w-fpm php71w-cli php71w-common php71w-json php71w-opcache php71w-mysql php71w-phpdbg php71w-mbstring php71w-gd php71w-imap php71w-ldap php71w-pgsql php71w-pspell php71w-recode php71w-soap php71w-tidy php71w-devel php71w-intl php71w-curl php71w-zip php71w-xml php71w-pecl-xdebug
# For remi repo
# Source: https://blog.remirepo.net/post/2016/12/05/Install-PHP-7.1-on-CentOS-RHEL-or-Fedora
$ wget http://rpms.remirepo.net/fedora/remi-release-25.rpm
$ sudo dnf install remi-release-25.rpm
$ dnf install dnf-plugins-core
$ dnf config-manager --set-enabled remi-php71
$ sudo dnf install -y php php-fpm php-cli php-common php-json php-opcache php-mysql php-mbstring php-gd php-imap php-ldap php-pgsql php-pspell php-recode php-soap php-tidy php-devel php-intl php-curl php-zip php-xml php-intl php-pecl-xdebug
/var/run/php/php7.1-fpm.sock
Paste the following to /etc/php/7.1/mods-available/xdebug.ini
:
zend_extension=xdebug.so # If not already
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"
All done.
Thanks! The php7.0-snmp gave me a lot of errors when executing php command in command line, so I've deleted it