我使用XAMPP,我已经configuration它为了创build本地创build的每个项目的虚拟主机。
在我的php.ini中,我启用了xdebug,我的脚本正常工作。 我的意思是说,任何时候有一个警告,通知,错误,由xdebug报告。
现在我想启用Xdebug事件探查器,并且为了允许Xdebug事件探查器生成日志文件,我已经对我的php.ini进行了以下更改:
; xdebug.profiler_enable ; Type: integer, Default value: 0 ; Enables Xdebugs profiler which creates files in the profile output directory. Those files can be ; read by KCacheGrind to visualize your data. This setting can not be set in your script with ini_set ; (). xdebug.profiler_enable = 1 ; xdebug.profiler_output_dir ; Type: string, Default value: /tmp ; The directory where the profiler output will be written to, make sure that the user who the PHP ; will be running as has write permissions to that directory. This setting can not be set in your ; script with ini_set(). xdebug.profiler_output_dir ="D:\Web Development Projects\Profile"
我重新启动我的Apache,但仍然当我运行我的脚本没有生成文件夹configuration文件中的文件。
还有什么我必须做的?
我已经阅读,以启用分析器: http : //xdebug.org/docs/profiler
经过一番研究之后,我在index.php的末尾添加了一个代码,在我的服务器中安装了一个WordPress安装程序:
echo xdebug_get_profiler_filename();
运行我的WordPress后,在页脚我得到的结果:
D:/Web Development Projects/Profile/xdebug_profile._::1320916508_018294
但是当我去的文件夹
D:/Web Development Projects/Profile/
该文件没有出现在那里? 任何想法 ?
首先,您需要确保运行您的Web服务器的用户实际上拥有对您指定的目录的写入权限,并且需要存在。 Xdebug也可能不喜欢路径中的空格,虽然这应该工作得很好,但我会尝试设置:
xdebug.profiler_output_dir = "D:/Web Development Projects/Profiler"
由于\ +字符可能是一个转义序列。
问题解决了!
由于日志文件名称而生成的问题。
我只是把它改为:
xdebug.profiler_output_name = "callgrind.out.%t-%s"
并正常工作!