首页 > 解决方案 > Mac Mojave PHP 7.19 使用 xdebug 进行配置

问题描述

我最近将我的 macbook pro 更新为 mojave,它已将 PHP 更新到 7.19。问题是 xdebug 已停止工作。我尝试编辑 /etc/php.ini 为 xdebug 添加以前的条目,但是现在当我启动 apache 时,我得到以下信息:

Failed loading /usr/local/opt/php71-xdebug/xdebug.so: dlopen(/usr/local/opt/php71-xdebug/xdebug.so, 0x0009): code signature in (/usr/local/opt/php71-xdebug/xdebug.so) not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

所以我想我会尝试重新安装 xdebug sudo pecl install xdebug- 这失败并出现以下错误:

/bin/sh /private/tmp/pear/temp/pear-build-rootFbhymt/xdebug-2.6.1/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/xdebug -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootFbhymt/xdebug-2.6.1/include -I/private/tmp/pear/temp/pear-build-rootFbhymt/xdebug-2.6.1/main -I/private/tmp/pear/temp/xdebug -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/xdebug/xdebug.c -o xdebug.lo mkdir .libs

cc -I. -I/private/tmp/pear/temp/xdebug -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootFbhymt/xdebug-2.6.1/include -I/private/tmp/pear/temp/pear-build-rootFbhymt/xdebug-2.6.1/main -I/private/tmp/pear/temp/xdebug -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/xdebug/xdebug.c -fno-common -DPIC -o .libs/xdebug.o /private/tmp/pear/temp/xdebug/xdebug.c:25:10: fatal error: 'php.h' file not found

#include "php.h"

^~~~~~~

1 error generated.

make: *** [xdebug.lo] Error 1

ERROR:使'失败`

这有点高于我的工资等级,我认为......看起来由于某种原因无法找到 php.h,但现在我被卡住了!

我该如何解决这个问题?

编辑

作为对此的更新,我还可以看到运行命令时 phpize 失败:

`

downloading xdebug-2.6.1.tgz ...
Starting to download xdebug-2.6.1.tgz (283,961 bytes)
..........................................................done: 283,961 bytes
79 source files, building
running: phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:

`

我确实发现这篇文章Unable to use PHPIZE after update to MacOS Mojave有人遇到了同样的问题,但我真的不明白......我是否必须更改 phpize 文件的内容,怎么办?

标签: phpxdebugmacos-mojave

解决方案


推荐阅读