我已经通过以下命令在ubuntu 16.04中安装了php 7.1:
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.1-fpm
在此步骤之后,我只按照Xdebug Tailored Installation Instructions
中的说明进行操作,如下所示:
Summary
Xdebug installed: no
Server API: FPM/FastCGI
Windows: no
Zend Server: no
PHP Version: 7.1.18-1
Zend API nr: 320160303
PHP API nr: 20160303
Debug Build: no
Thread Safe Build: no
Configuration File Path: /etc/php/7.1/fpm
Configuration File: /etc/php/7.1/fpm/php.ini
Extensions directory: /usr/lib/php/20160303
Instructions
Download xdebug-2.6.0.tgz
Unpack the downloaded file with tar -xvzf xdebug-2.6.0.tgz
Run: cd xdebug-2.6.0
Run: phpize (See the FAQ if you don't have phpize.
As part of its output it should show:
Configuring for:
...
Zend Module Api No: 20160303
Zend Extension Api No: 320160303
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.
Run: ./configure
Run: make
Run: cp modules/xdebug.so /usr/lib/php/20160303
Edit /etc/php/7.1/fpm/php.ini and add the line
zend_extension = /usr/lib/php/20160303/xdebug.so
Restart the webserver
重新启动网络服务器(NGINX)后,我无法在phpinfo()显示中看到xdebug扩展:
这是我的php.ini:/etc/php/7.1/fpm/php.ini
[xdebug]
zend_extension = /usr/lib/php/20160303/xdebug.so
即使是建议here in this post的xdebug 2.5.5也无效,甚至不是Xdebug 2.7.0alpha1
php -v
PHP 7.1.18-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jun 11 2018 14:22:30) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.18-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
有人知道如何解决这个问题吗?