phpstorm远程调试器(xdebug)for laravel

发布于 2025-01-30 09:25:14 字数 2014 浏览 7 评论 0原文

我一直在尝试通过Xdebug通过PHPSTORM进行远程调试,这是一天中最好的部分,但是尽管我尽了最大的努力,但仍无法使其正常工作。

当我去验证部署配置时,我会在下面看到错误:

“指定的URL是无法达到的,是由以下原因引起的:'请求因状态代码406'而失败。

“指定的URL是无法达到的,是由以下 https://i.sstatic.net/gvbfu.png“ alt =” validate debugger配置错误“>

jetbrains atbrains故障排除指南我创建/代码>文件,然后将其放入服务器上的公共文件夹中,我能够访问它。我的映射基本上也与他们指南的底部相匹配。

我能够通过在cpanel中选择php版本在服务器上安装/启用Xdebug,并在 Extensions 下启用Xdebug。

我已经将以下内容添加到网站的.htaccess file(在/public中找到):

zend_extension=xdebug.so
php_flag zend_extension=xdebug.so
php_flag xdebug.mode=debug
php_flag xdebug.remote_enable=1
php_flag xdebug.remote_autostart on
php_flag xdebug.remote_connect_back=1
php_flag xdebug.remote_port=9000
php_flag xdebug.max_nesting_level=512
php_flag xdebug.remote_host=127.0.0.1
php_flag xdebug.idekey=PHPSTORM

我找不到其他任何错误的人,所以我不知道在哪里问题在于。配置有问题吗?我必须更改PHP设置吗? xdebug设置?

在我尝试设置远程调试之前,我能够通过Homestead进行本地调试,并且在适用的情况下进行了许多设置。老实说,我不确定我要去哪里出错,我将不胜感激。

根据phpinfo()在服务器上转储,以下是一些相关详细信息:

  • phpstorm:2021.3.2
  • 客户端OS:Mac OS Monteray 12.3.1
  • PHP:7.4.29
  • Server OS:Linux
  • Xdebug:V2:V2 .8.0

更新:

在提交此问题后,我在phpinfo()页面上向下滚动,并注意到Xdebug变量列出了其默认值。看来.htaccess文件中的php_flag不起作用。这是正确的假设,还是不影响信息转储?

更新2:

我已经调整了我的.htaccess文件,现在Xdebug变量似乎已正确设置。它仍然没有解决406错误,但是除非我仍然缺少选项,否则应该排除XDebug作为原因。

I've been trying to setup remote debugging through PhpStorm with Xdebug for the best part of the day but have been unable to get it working despite my best efforts.

When I go to validate the deployment configuration, I get the error seen below:

"Specified URL is not reachable, caused by: 'Request failed with status code 406'"

Validate Debugger Configuration error

Following the JetBrains troubleshooting guide, I created a test.php file and put that in the public folder on the server and I was able to access that. My mappings also basically match what they have in the bottom of their guide.

I was able to install/enable Xdebug on the server by going to Select PHP Version in cPanel and enabling xdebug under Extensions.

I've added the following to the site's .htaccess file (found in /public):

zend_extension=xdebug.so
php_flag zend_extension=xdebug.so
php_flag xdebug.mode=debug
php_flag xdebug.remote_enable=1
php_flag xdebug.remote_autostart on
php_flag xdebug.remote_connect_back=1
php_flag xdebug.remote_port=9000
php_flag xdebug.max_nesting_level=512
php_flag xdebug.remote_host=127.0.0.1
php_flag xdebug.idekey=PHPSTORM

I cannot find anyone else with the same error so I don't know where the problem lies. Is there something wrong with the configuration? Do I have to change PHP settings? Xdebug settings?

Before I attempted to setup remote debugging, I was able to get local debugging working through Homestead and a lot of my settings match where applicable. I'm just honestly not sure where I'm going wrong and I would appreciate any and all help in this matter.

According to a phpinfo() dump on the server, here are some relevant details:

  • PhpStorm: 2021.3.2
  • Client OS: Mac OS Monteray 12.3.1
  • PHP: 7.4.29
  • Server OS: Linux
  • Xdebug: v2.8.0

UPDATE:

I scrolled down on the phpinfo() page after submitting this question and noticed that the Xdebug variables are listed with their defaults. It appears that the php_flag in the .htaccess file isn't working. Is that a correct assumption or will it not affect the info dump?

enter image description here

UPDATE 2:

I have adjusted my .htaccess file and now Xdebug variables appear to be getting set correctly. It still hasn't resolved the 406 error however which should rule out Xdebug as the cause unless I'm still missing options.

Updated phpinfo

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文