问题
After installing xdebug extentions as follows
- Download xdebug-2.6.0alpha1.tgz
- Unpack the downloaded file
- Run: cd xdebug-2.6.0alpha1
- Run: phpize
- Run: ./configure
- Run: make
- Run: cp modules/xdebug.so /usr/local/Cellar/php70/7.0.26_18/lib/php/extensions/no-debug-non-zts-20151012
- Edit /usr/local/etc/php/7.0/php.ini and add the line zend_extension = /usr/local/Cellar/php70/7.0.26_18/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so
I get the error when run php -v
Failed loading /usr/local/Cellar/php70/7.0.26_18/lib/php/extensions
/no-debug-non-zts-20151012/xdebug.so:
dlopen(/usr/local/Cellar/php70/7.0.26_18/lib/php/extensions
/no-debug-non-zts-20151012/xdebug.so, 9): no suitable image found.
Did find:
/usr/local/Cellar/php70/7.0.26_18/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so:
stat() failed with errno=20
When I use the service of Xdebug analyse popinfo() output, it will ask the exactly the same steps to do.
It am not sure what no suitable image found means. The path exists. Could anyone have any ideas how to fix it?
回答1:
I sorted the problem out by adding
export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"
on .bash_profile.
PHP 7.1 came with OSX 10.13.2, so default path was set to the pre-packed php, which shows the error on phpinfo.
来源:https://stackoverflow.com/questions/47824263/failed-loading-xdebug-installation-xdebug-so-9-no-suitable-image-found