尽管一步一步遵循了所有教程,断点和 php 调试仍然不起作用。
这是我的设置:
PHPStorm 9.0.2,服务器位于“C:/Users/hedge/Dev/PHPStorm/gpstudios/dist”
带有 xdebug 2.3.3-5.6-vc11 的 XAMPP
php.ini:
[XDebug]
zend_extension = "C:\Dev\XAMPP\php\ext\php_xdebug-2.3.3-5.6-vc11.dll"
xdebug.remote_enable = 1
xdebug.remote_host = 127.0.0.1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.idekey = "PHPSTORM"
xdebug.profiler_enable = 1
xdebug.remote_log = "C:\Dev\XAMPP\tmp\xdebug.log"
httpd-vhosts.conf:
<VirtualHost *:80>
DocumentRoot "C:/Users/hedge/Dev/PHPStorm/gpstudios/dist"
ServerName local.gpstudios
<Directory "C:/Users/hedge/Dev/PHPStorm/gpstudios/dist">
Header set Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
主机:
127.0.0.1 local.gpstudios
Jetbrains IDE 支持(Chrome):
在 phpstorm 中,当我在 phpstorm 中运行“Web 服务器调试验证”时:
我尝试将 xdebug.remote_host 设置为“local.gpstudios”,但仍然没有帮助。
我在 Debug模式下运行 phpstorm 并启用“监听 php 调试连接” 'C:\Dev\XAMPP\tmp\xdebug.log' 永远不会被创建。
如果我将“xdebug.remote_autostart = 1”行添加到 php.ini,php 调试就可以工作了!!!但是当我使用 phpmyadmin 时,它运行得很慢,我不想考虑使用这个解决方法。 我已经尝试了一切,查看了大量类似的 stackoverflow 问题。没有什么。翻转。有效。
请帮忙,我知道有一个快速的解决方法,但它确实使 phpmyadmin 非常慢。我不应该设置remote_autostart...真的为此抓狂。
最佳答案
如果没有 xdebug.remote_autostart = 1
选项,您必须为每个域启用 xdebug。您可以通过向要调试的站点添加新书签来完成此操作。
作为辅助工具,我可以推荐以下工具:
- https://www.jetbrains.com/phpstorm/marklets/ - 跨浏览器书签,只需将其拖放到书签栏,然后按“启动调试器”即可启用它。
- https://addons.mozilla.org/hu/firefox/addon/the-easiest-xdebug/ - 对于火狐浏览器
- https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc - 对于 Chrome
关于PHPStorm 9 + XAMPP + xdebug,调试器不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32400054/