I wanted to work on a PHP project and as usual I start MAMP to boot up the test server. 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. Still that error:
"The connection of this website is not secured - ERR_SSL_PROTOCOL_ERROR".
I switched of browser first Edge and then Safari, nothing changed. 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. It didn't work either. Finally, hopeless, I tried uninstalling MAMP and reinstall it and even tried XAMPP, still no more results.
I'm desperate if anyone had a solution, I would be infinitely grateful!
Edit: Here my httpd.conf file
<https://pastebin.com/SHJ8CdrA>
Edit 2: Here's the new httpd.conf
file
<https://pastebin.com/fdZe4RhU>
Edit 3: Here is my 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. 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.
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.
TL;DR : Always check your config files and check on another machine.