Xdebug分析器无法正常工作? [英] Xdebug profiler is not working?

查看:124
本文介绍了Xdebug分析器无法正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用XAMPP并对其进行了配置,以使我在本地创建的每个项目都具有虚拟主机.

I using XAMPP and I have configure it in order to have virtual hosts for each project I create localy.

在我的php.ini中,我启用了xdebug,并且我的脚本运行正常.我的意思是,任何时候xdebug都会报告警告,通知,错误.

In my php.ini I have enabled xdebug, and my scripts are working properly. I mean that any time there is a warning, notice, error, are reported by the xdebug.

现在,我想启用Xdebug分析器,并且对php.ini进行了以下更改,以允许Xdebug分析器生成日志文件:

Now I would like to enable the Xdebug profiler, and I have make the following changes into my php.ini in order to allow the Xdebug profiler to generate the log file:

; 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,但是运行脚本时,仍然没有在Profile文件夹中生成文件.

I restart my Apache, but still when I run my scripts there is no file generated in folder Profile.

还有什么要做的吗?

为了使探查器有效,我已阅读以下内容: http://xdebug.org/docs/profiler

I have read that in order to enable the Profiler : http://xdebug.org/docs/profiler

经过研究,我将代码添加到服务器中已安装的WordPress安装中的index.php的末尾:

After some research, I add that code at the end of the index.php in a WordPress installation I have in my server:

echo xdebug_get_profiler_filename();

运行WordPress之后,在页脚处会得到以下结果:

After I run my WordPress, at the footer I get that result:

D:/Web Development Projects/Profile/xdebug_profile._::1320916508_018294

但是当我转到文件夹

D:/Web Development Projects/Profile/

文件没有出现在那儿?有什么主意吗?

the file is not appeared there ? Any idea ?

推荐答案

首先,您需要确保运行Web服务器的用户实际上对您指定的目录具有写权限,并且它需要存在. Xdebug也可能不喜欢路径中的空格,尽管应该可以正常工作,但我还是尝试设置:

First of all, you need to make sure that the user under which your webserver runs at actually has write permissions to the directory that you specified— and it needs to exist. It is also possible that Xdebug doesn't like spaces in paths, Although that should work just fine, I would try setting:

xdebug.profiler_output_dir = "D:/Web Development Projects/Profiler"

因为\ +字符可能是一个转义序列.

As the \ + char might be an escape sequence.

这篇关于Xdebug分析器无法正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆