【问题标题】:xdebug with php 7 on ubuntu apache2 not working在ubuntu apache2上使用php 7进行xdebug无法正常工作
【发布时间】:2016-05-20 20:33:20
【问题描述】:

实际上有这个问题,我花了很多时间来找出解决方案:(如果安装了任何以前的 php 版本,请确保首先完全摆脱它们。如有必要,清除并重新安装 apache2 和 php7)

第一:

> sudo apt-get install php-xdebug

然后编辑php 7的php.ini文件:

> sudo gedit /etc/php/7.0/apache2/php.ini

然后在底部添加:

xdebug.remote_enable = On

保存,然后:

> sudo service apache2 restart

【问题讨论】:

  • 进一步暂时禁用 XDebug:> sudo phpdismod xdebug 或 > sudo phpenmod xdebug
  • 通过sudo apt-get install php-xdebug 安装xdebug 并将xdebug.remote_enable = On 添加到我的php.ini 中,它可以在安装了PHP7.0 和netbeans 的Ubuntu 16.04 上运行,谢谢。

标签: apache2 ubuntu-14.04 xdebug php-7


【解决方案1】:

下载xdebug 2.4.0稳定版

wget -c "http://xdebug.org/files/xdebug-2.4.0.tgz"

提取档案

tar -xf xdebug-2.4.0.tgz

cd xdebug-2.4.0/

构建扩展

phpize
./configure
make && make install

启用扩展

echo "zend_extension=xdebug.so" > /etc/apache2/mods-available/xdebug.ini

ln -sf /etc/apache2/mods-available/xdebug.ini /etc/apache2/mods-enabled/20-xdebug.ini
ln -sf /etc/apache2/mods-available/xdebug.ini /etc/apache2/mods-enabled/20-xdebug.ini

service php7.0-fpm restart

检查一下

php -m | grep -i xdebug

它应该打印:

xdebug
Xdebug

【讨论】:

    猜你喜欢
    • 2017-09-15
    • 2017-12-08
    • 2011-11-20
    • 2014-06-13
    • 2018-12-24
    • 1970-01-01
    • 2012-03-25
    • 2022-10-21
    • 1970-01-01
    相关资源
    最近更新 更多