小编Ger*_*ong的帖子

使用PHP 7在macOS 10.13上进行Xdebug

所以macOS High Sierra 10.13现在配备了PHP 7.1.配置Apache时我也/etc/php.ini/etc/php.ini.default文件中创建了一个新的,确保在重新启动Apache后检查是否由PHP加载,但是当你运行时,macOS 10.13附带的Xdebug扩展版本似乎没有加载或显示phpinfo();

我的php.ini肯定被加载:

$ php -i | grep php.ini
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
Run Code Online (Sandbox Code Playgroud)

这是我的/etc/php.ini在配置Xdebug时的样子:

[xdebug]    
zend_extension = "/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so"
xdebug.remote_enable=on
xdebug.remote_log="/var/log/xdebug.log"
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
Run Code Online (Sandbox Code Playgroud)

[更新,修复了这里的拼写错误...]

但是,Xdebug不加载和检查php -i没有结果:

$php -i | grep xdebug
PHP Warning:  Method xdebug_start_function_monitor() cannot be a NULL 
    function in Unknown on line 0
    PHP Warning:  xdebug: Unable to register functions, unable to load in Unknown on line 0
    Segmentation fault: …
Run Code Online (Sandbox Code Playgroud)

php apache xdebug macos-high-sierra

12
推荐指数
2
解决办法
8164
查看次数

标签 统计

apache ×1

macos-high-sierra ×1

php ×1

xdebug ×1