4

问题是如果我通过浏览器从我的服务器请求任何页面,我不会从 Xdebug-Profiler 获得任何输出。如果我在终端中使用 php 调用脚本,例如

php /var/www/html/index.php

然后将创建分析器的输出。所以我想我的配置很好。这是我的 phpinfo 中的重要设置:

xdebug.profiler_aggregate   Off Off
xdebug.profiler_append  Off Off
xdebug.profiler_enable  On  On
xdebug.profiler_enable_trigger  Off Off
xdebug.profiler_enable_trigger_value    no value    no value
xdebug.profiler_output_dir  /home/duser/profiler /home/duser/profiler
xdebug.profiler_output_name testgrind.out.%t-%s testgrind.out.%t-%s

我的 phpinfo 的https://xdebug.org/wizard.php的输出:

   Xdebug 安装:2.5.4
   服务器 API:Apache 2.0 处理程序
   窗户:没有
   Zend 服务器:没有
   PHP版本:5.6.30
   Zend API 编号:220131226
   PHP API 编号:20131226
   调试构建:否
   线程安全构建:否
   配置文件路径:/etc
   配置文件:/etc/php.ini
   扩展目录:/usr/lib64/php/modules
   您已经在运行最新的 Xdebug 版本

我在这里阅读了很多主题,人们有类似的问题,而且通常是权利问题。因此,我在我的主目录中创建了 profiler 文件夹,其权限如下:

   drwxrwxrwx   2 duser duser  140 30. Jun 07:02 profiler

服务器在 Centos 7 上运行,SELinux 被禁用。Xdebug 调试器工作正常。任何帮助将不胜感激。

4

1 回答 1

4

问题是,apache 无法访问我的 /home/duser/profiler 文件夹。xdebug 的输出必须保存在 /var/www/html/ 或配置需要调整,以便 apache 可以访问特定路径。

于 2017-07-21T07:09:06.683 回答