在PHPStorm调试功能中启用https连接的任何方法



我正在运行一个拼凑的WAMP服务器,并在一个只在SSL中运行的应用程序上工作。我需要调试它,但PHPStorm没有提供任何方法来设置调试以理解SSL,结果:我得到一个"错误的请求"。

回答晚了,但我是从谷歌来的。如果您将端口80上的流量重定向到HTTPS/443,则HTTPS将与xdebug一起工作。

使用Apache,您可以像这样添加虚拟主机(从这里):

NameVirtualHost *:80
<VirtualHost *:80>
   ServerName mysite.example.com
   DocumentRoot /usr/local/apache2/htdocs
   Redirect permanent /secure https://mysite.example.com/secure
</VirtualHost>
<VirtualHost _default_:443>
   ServerName mysite.example.com
   DocumentRoot /usr/local/apache2/htdocs
   SSLEngine On
# etc...
</VirtualHost>

我用的是nginx和php-fpm所以我添加了这个block来重定向

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name _;
    return 301 https://$host$request_uri;
}

更多信息在这里。使用这个并将我的PHPStorm服务器配置为:80点击https,连接到xdebug并正常中断。理想情况下,我们可以在PHPStorm中更改协议,但我没有看到这个选项。

相关内容

最新更新