简体   繁体   English

在unix上安装xdebug php profiler

[英]Installing xdebug php profiler on unix

I want to start profiling some PHP code and I have that using xdebug and webgrind seems to be the way to go. 我想开始分析一些PHP代码,而使用xdebugwebgrind似乎是解决之道。

I downloaded xdebug and got these instructions.. 我下载了xdebug并获得了这些说明。

Unpack the downloaded file with tar -xvzf xdebug-2.2.3.tgz
Run: cd xdebug-2.2.3

Now, this may be a stupid question, but where exactly should I upload xdebug to so it can be unpacked? 现在,这可能是一个愚蠢的问题,但是我应该将xdebug确切地上传到哪里才能解压缩? Does it matter? 有关系吗? I assume it shouldn't be web-accessible? 我认为它不应该可以通过网络访问?

It is assumed you have Apache2 + PHP5 working already. 假设您已经可以使用Apache2 + PHP5。

sudo apt-get install php5-dev php-pear

Now install xdebug thru PECL. 现在通过PECL安装xdebug。

sudo pecl install xdebug

Now we need to find where xdebug.so went (the compiled module) 现在我们需要找到xdebug.so的去向(编译模块)

martin@martin-dev:/$ find / -name 'xdebug.so' 2> /dev/null
/usr/lib/php5/20060613/xdebug.so

Then edit php.ini: 然后编辑php.ini:

sudo gedit /etc/php/apache2/php.ini

Add the following line: 添加以下行:

zend_extension="/usr/lib/php5/20060613/xdebug.so"

Then restart apache for changes to take effect 然后重新启动apache以使更改生效

sudo /etc/init.d/apache2 restart

and see 看看

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM