是否通过自制软件安装:
brew install homebrew/php/php70-xdebug
或仅使用
./configure
或以下代码从位于http://xdebug.org的源进行编译:./configure --enable-xdebug CC="gcc -arch i386" CXX="g++ -arch i386"
make
当运行与Acquia DevDesktop捆绑在一起的php7时,我仍然收到以下消息:
Failed loading /Applications/DevDesktop/php7_0/ext/xdebug.so: dlopen(/Applications/DevDesktop/php7_0/ext/xdebug.so, 9): no suitable image found. Did find:
/Applications/DevDesktop/php7_0/ext/xdebug.so: mach-o, but wrong architecture
我确认的事情:
which php
返回/ Applications / DevDesktop / php7_0 / bin / php php -i
显示正确的.ini文件(/Applications/DevDesktop/php7_0/bin/php.ini),没有其他zend_extension="/Applications/DevDesktop/php7_0/ext/xdebug.so"
在php.ini中php --version
返回的完整消息是:$ php --version
Failed loading /Applications/DevDesktop/php7_0/ext/xdebug.so: dlopen(/Applications/DevDesktop/php7_0/ext/xdebug.so, 9): no suitable image found. Did find:
/Applications/DevDesktop/php7_0/ext/xdebug.so: mach-o, but wrong architecture
PHP 7.0.4 (cli) (built: Mar 18 2016 02:12:27) ( ZTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
该操作系统是MacBook Air上Mac OS 10.11.5的全新安装。
有谁知道它为什么抱怨错误的架构?
最佳答案
对于DevDesktop,这对我有用:
cd xdebug-2.5.5
/Applications/DevDesktop/php7_0/bin/phpize
而现在,这一步引起了最大的忧虑。
./configure --with-php-config=/Applications/DevDesktop/php7_0/bin/php-config CC="gcc -arch i386" CXX="g++ -arch i386"
make
cp modules/xdebug.so /Applications/DevDesktop/php7_0/ext/
php7_0/bin/php.ini
文件,并(假定它是默认值)替换:zend_extension="/Applications/DevDesktop/php5_6/ext/opcache.so"
与
;zend_extension="/Applications/DevDesktop/php5_6/ext/opcache.so"
[Xdebug]
zend_extension="/Applications/DevDesktop/php7_0/ext/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000