简体   繁体   English

MAMP - 无法访问任何页面 ERR_SSL_PROTOCOL_ERROR

[英]MAMP - Can't access any page ERR_SSL_PROTOCOL_ERROR

I wanted to work on a PHP project and as usual I start MAMP to boot up the test server.我想在 PHP 项目上工作,并且像往常一样启动 MAMP 来启动测试服务器。 But instead of my page I got an error message.但我收到的不是我的页面,而是一条错误消息。

First, I started to investigate on the MAMP software, I change the ports, I tried changing the location of the root folder, it didn't change anything.首先,我开始研究 MAMP 软件,我更改了端口,我尝试更改根文件夹的位置,它没有改变任何东西。 Still that error:还是那个错误:

"The connection of this website is not secured - ERR_SSL_PROTOCOL_ERROR". “本网站的连接不安全 - ERR_SSL_PROTOCOL_ERROR”。

I switched of browser first Edge and then Safari, nothing changed.我先切换浏览器 Edge,然后切换 Safari,没有任何改变。 I looked up on Google the error and as it would seem, it comes from an invalid certificate.我在谷歌上查了这个错误,看起来,它来自一个无效的证书。 So, I tried forging one with openssl , I could't add the.pem file to the keychain tool, and I tried changing the configuration files http.conf and httpd-vhosts.conf to use the new certificate.所以,我尝试用openssl伪造一个,我无法将 .pem 文件添加到钥匙串工具中,我尝试更改配置文件http.confhttpd-vhosts.conf以使用新证书。 It didn't work either.它也没有用。 Finally, hopeless, I tried uninstalling MAMP and reinstall it and even tried XAMPP, still no more results.最后,无奈,我尝试卸载MAMP并重新安装它,甚至尝试了XAMPP,仍然没有更多结果。

I'm desperate if anyone had a solution, I would be infinitely grateful!如果有人有解决方案,我很绝望,我将无限感激!

Edit: Here my httpd.conf file编辑:这里是我的 httpd.conf 文件

<https://pastebin.com/SHJ8CdrA>

Edit 2: Here's the new httpd.conf file编辑 2:这是新的httpd.conf文件

<https://pastebin.com/fdZe4RhU>

Edit 3: Here is my httpd-ssl.conf编辑 3:这是我的httpd-ssl.conf

<https://pastebin.com/RMPJbp6q>

So, after a long time searching and testing, I got the same issue on my Windows PC with XAMPP.所以,经过长时间的搜索和测试,我在我的 Windows 电脑上遇到了同样的问题,XAMPP。 I don't remember exactly the fix but it was related to the configuration files http.conf and httpd-ssl.conf I just copy paste the files from my Windows PC to my Mac and it worked.我不记得确切的修复方法,但它与配置文件http.confhttpd-ssl.conf有关,我只是将 Windows PC 中的文件复制粘贴到我的 Mac 上,它就可以工作了。

In the meantime, I used the PHP command php -S localhost:8000 to run my application and I installed and ran a standalone instance of MySQL.与此同时,我使用 PHP 命令php -S localhost:8000运行我的应用程序,并安装并运行了 MySQL 的独立实例。

TL;DR: Always check your config files and check on another machine. TL;DR:始终检查您的配置文件并检查另一台机器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM