Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/257.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Xdebug探查器不工作?_Php_Windows_Xdebug - Fatal编程技术网

Php Xdebug探查器不工作?

Php Xdebug探查器不工作?,php,windows,xdebug,Php,Windows,Xdebug,我使用XAMPP并对其进行了配置,以便在本地创建的每个项目都有虚拟主机 在我的php.ini中,我启用了xdebug,我的脚本工作正常。我的意思是,任何时候出现警告、通知、错误都会被xdebug报告 现在我想启用Xdebug profiler,我对php.ini进行了以下更改,以允许Xdebug profiler生成日志文件: ; xdebug.profiler_enable ; Type: integer, Default value: 0 ; Enables Xdebugs profiler

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

在我的php.ini中,我启用了xdebug,我的脚本工作正常。我的意思是,任何时候出现警告、通知、错误都会被xdebug报告

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

; 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,但当我运行脚本时,文件夹配置文件中仍然没有生成任何文件

我还有别的事要做吗

我已经读到,为了启用探查器:


经过一些研究,我在服务器中的WordPress安装中的index.php末尾添加了该代码:

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"

而且工作正常

我忘了写操作系统是Windows让我试试。我会在这里回答一分钟,我只是做了更改,仍然没有什么。这个目录也需要是可写的对我来说,这是写权限,简单的事情,但我们发现自己在寻找复杂的解决方案。谢谢。:)注意:如果您使用的是类似WinCacheGrind的东西,它只能识别一种类型的文件,那么名称应该是
cachegrind
而不是
callgrind
。@KodeFor.me您能为php.ini文件编写所有配置吗?。“我正在尝试,但没有用。@MuradShukurlu这是一个有四年历史的项目,不幸的是,它已经不存在了,除此之外,我甚至不记得我设置了什么选项。有用的资源在这里:和@KodeFor.Me谢谢!,在查看变更日志后,我已经解决了这个问题。