我通过以下命令在 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
甚至本文中建议的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
有人知道如何解决这个问题吗?
我和你有同样的问题。尽管过去曾多次使用定制指令,但他们似乎不想在这种特定配置上工作,我无法确切说明原因。
但是,我非常简单地使用以下方法成功安装了它:
不知道你是否还有问题,但我希望它可以帮助某人。同样的问题来自这里:https ://petersproblems.wordpress.com/