[英]How to enable XDebug extension on my php?
I am running php on a macbook pro running mountain lion. 我在运行山狮的macbook pro上运行php。 Mountain lion comes with XDebug pre-installed, so based on a tutorial I've found , I made three steps.
Mountain Lion预装了XDebug,所以根据我发现的教程,我做了三个步骤。 First I've uncomment this line in my php.ini :
首先,我在php.ini中取消注释这一行:
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
Secondly I've uncomment this line in my php.ini : 其次,我在php.ini中取消注释这一行:
xdebug.remote_enable=1
And finally I restarted the apache server with : 最后我重新启动了apache服务器:
sudo apachectl restart
The problem is that I see no xdebug appearing in my php details when I run a phpinfo(). 问题是当我运行phpinfo()时,我看到我的php细节中没有出现xdebug。 Thank you.
谢谢。
PS : The path of the above xdebug.so file is correct. PS:上面的xdebug.so文件的路径是正确的。
I am answering my own question because Mountain Lion is a special case when it comes to running XDebug. 我正在回答我自己的问题,因为在运行XDebug时,Mountain Lion是一个特例。
As you can see here, mountain lion comes with an older xdebug.so
library. 正如你在这里看到的,山狮配有一个较旧的
xdebug.so
库。 So the user must re-compile the library himself. 因此用户必须自己重新编译库。
Here is how to do it. 这是怎么做的。
source
link.) source
链接下获取文件。) tar -xvzf xdebug-2.2.1.tgz
tar -xvzf xdebug-2.2.1.tgz
解压缩下载的文件 cd xdebug-2.2.1
cd xdebug-2.2.1
phpize
phpize
./configure
./configure
make
make
sudo cp modules/xdebug.so /usr/lib/php/extensions/no-debug-non-zts-20090626
sudo cp modules/xdebug.so /usr/lib/php/extensions/no-debug-non-zts-20090626
sudo apachectl restart
sudo apachectl restart
Web服务器 Check you are editing the same php.ini that shows up in phpinfo() in the broswer. 检查您是否正在编辑在broswer中显示在phpinfo()中的相同php.ini。
Here are my settings (I'm also on a Macbook Pro on Mountain Lion btw): 这是我的设置(我也在Mountain Lion btw的Macbook Pro上):
xdebug.var_display_max_children = 999
xdebug.var_display_max_data = 99999
xdebug.var_display_max_depth = 100
;zend_extension_ts=php_xdebug.dll
xdebug.remote_enable=On
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
Works for me. 适合我。 Does any of that help?
这有什么帮助吗?
This set of instructions worked for me. 这套说明适合我。
It successfully uses OSX Mountain Lion's
native Apache2
and XDebug
together with MacGDBp
and a Safari extension called XDebug Helper
. 它成功地使用了
OSX Mountain Lion's
原生Apache2
和XDebug
以及MacGDBp
和一个名为XDebug Helper
的Safari扩展。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.