I have recently updated my macbook pro to mojave which has updated PHP to 7.19. The problem is that xdebug has stopped working. I tried editing /etc/php.ini adding in the previous entries for xdebug, but now when I start apache I get the following:
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.
So I thought I'd try and reinstall xdebug - sudo pecl install xdebug
- this fails with the following errors:
/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:
make' failed`
This a bit above my pay grade to sort out I think... it looks like for some reason php.h can't be found, but now I'm stuck!
How do I resolve this?
EDIT
As an update to this, I can also see that phpize is failing when I run the command:
`
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:
`
I did find this post Unable to use PHPIZE after update to MacOS Mojave where someone was having the same problems, but I don't really get it... do I have to change the contents of phpize file, what to?