我最近在我的服务器上安装了Xdebug,目的是将它用于代码分析。 它似乎安装正确,phpinfo列出以下内容:
xdebug.profiler_enable On On xdebug.profiler_enable_trigger Off Off xdebug.profiler_output_dir /var/www/vhosts/xdebug /var/www/vhosts/xdebug xdebug.profiler_output_name cachegrind.out.%p cachegrind.out.%p
然而,我无法弄清楚为什么我运行PHP脚本时没有创buildcachgrinds。
有什么我失踪,或不正确的理解?
尝试删除选项
xdebug.profiler_enable_trigger Off Off xdebug.profiler_output_dir /var/www/vhosts/xdebug /var/www/vhosts/xdebug xdebug.profiler_output_name cachegrind.out.%p cachegrind.out.%p
首先是默认的,所以它是多余的。 删除其他2将让你找出问题是与这些选项,或其他。
重启Apache,点击一个php页面,看看/ tmp中是否有输出。 这是输出日志的默认位置。
如果有什么东西产生,那么你可以相当肯定这是你的输出目录的权限问题。
检查/ tmp中生成的文件的所有者,并确保用户对/ var / www / vhosts / xdebug具有写权限(从原始configuration),并重新添加最初的选项。
我想现在来不及回答。
我使用pecl安装了xdebug,我刚刚在/etc/php5/apache2/php.ini中通过添加
extension=xdebug.so xdebug.default_enable=1; in my setting, i set this parameter to 0 xdebug.scream=1 xdebug.profiler_enable=1 ; this activate the profiler by default. ;You can put it off (0), but should activate it by triggring. xdebug.profiler_enable_trigger=1 ; if you do like this, you need to call your script by adding XDEBUG_PROFILE=1 ;to your url for example: http://mytest/test.php?XDEBUG_PROFILE=1
你应该重新启动你的networking服务器,并从你的导航器调用一个PHP页面。 默认输出将在/ tmp中创build。
希望这个帮助。