XDebug profiling in PHP - can't get output

六眼飞鱼酱① 提交于 2019-11-30 23:48:41

问题


I've got a strange issue. I've setup XDebug to profile a PHP application we're working on. I believe everything is setup correctly but I get no output when I run it. My configuration looks like this:

zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so
[XDebug]
xdebug.profiler_append = 1
xdebug.profiler_enable = 0 (I've tried this both on and off)
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = "/debug/xdebug/profiler_output_dir"
xdebug.profiler_output_name = "cachegrind.out.%p"

All the phpinfo() settings match up like they should. The permissions on the output directory are set to 777 right now just so I can test it. I've tried using a directory under public_html as well but no luck. The URL I'm using to launch the profiler is:

http://example.com/my_page.php?XDEBUG_PROFILE
-or-
http://example.com/my_page.php?XDEBUG_PROFILE=1

Neither works. Any help would be GREATLY appreciated!! This app has a 5-6 second page load time and I haven't been able to trace it through code.


回答1:


Comment out xdebug.profiler_output_dir and xdebug.profiler_output_name and see whether you can find the output under /tmp/.




回答2:


There is also problem with /tmp folders on some distributions, i couldnt get output on centos 7 and then i found this

So, i have set

xdebug.profiler_output_dir=/home/jirka/profile

chmod 777 /home/jirka/profile and its ok now.




回答3:


Another possible cause of this issue is the permissions on the folder of profiler_output_dir.

Adding write permissions to the group and owner resolved the issue for me:

sudo chmod go+w /home/dimitris/cachegrind/



回答4:


Also, beware of access restrictions, such as access rights, groups, owner and SElinux...




回答5:


The full path was required, not just the path:

xdebug.profiler_append=1
xdebug.profiler_output_dir ="/home/username/debug/xdebug/profiler_output_dir"
xdebug.profiler_output_name = "cachegrind.out.%s.%H"


来源:https://stackoverflow.com/questions/3450500/xdebug-profiling-in-php-cant-get-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!