在htaccess文件中设置xdebug 3配置值



我试图在.htaccess文件中设置一些xdebug 3配置值,但我一直得到"500内部服务器错误";后果

使用xdebug2,我可以使用php_flag指令设置配置值,例如:

php_flag xdebug.remote_autostart on

对于xdebug 3,xdebug配置设置已经更改,但除了一个设置外,其他所有设置都应该在.htaccess中可用(xdebug.mode是唯一的例外(。根据xdebug文档:

除非特别指出,每个设置都可以在php.ini、99-xdebug.ini等文件中设置,也可以在Apache的.htaccess和php-FPM的.user.ini文件中设置。

我也尝试在.htaccess中设置XDEBUG_CONFIG环境变量,但PhpStorm没有遵守它(设置XDEBUG_CONFIG不会生成"500"页(。

SetEnv XDEBUG_CONFIG "start_with_request=yes client_host=localhost"

我可以在php.ini文件中启用xdebug,但我不希望为我正在运行的所有本地php代码启用它。在.htaccess文件中启用xdebug使我只能为特定的项目或代码启用它。

我在macOS上通过MAMP运行PHP 8.0,并使用xdebug v3.0.0在PhpStorm 2021.3中进行编码/调试。

如有任何帮助,我们将不胜感激。

这个问题是"已解决";通过修复我的CCD_ 10指令中的语法错误。当我从php.ini文件复制工作设置时,我忘记删除设置和值之间的=

# incorrect - caused the "500 Internal Server Error" results
php_flag xdebug.start_with_request=yes
# correct = without the "="
php_flag xdebug.start_with_request yes

抱歉报错警了。

最新更新