Jump to content
Larry Ullman's Book Forums

Can't connect to checkout.php page

Recommended Posts

Hi Larry,

Hope you are well.

I am having serious problems trying to implement a ssl certificate in order to test the https://localhost/checkout.php page in chapter 10.

I am using a macbook pro, and using mamp.

I tried created all the necessary files needed to to generate the certificate, but my problem starts when i try and edit the httpd.conf and http-ssl.conf files.


In the httpd.conf file i have the following settings:

Listen 8888

ServerName localhost:8888

Include /Applications/MAMP/conf/apache/extra/httpd-ssl.conf


In my httpd-ssl.conf file I have:

Listen 443

<VirtualHost  *:443>

ServerName localhost:8888

SSLCertificateFile "/mypath/server.crt"

SSLCertificateKeyFile "/mypath/server.key"


I then try and restart the apache server, but it states that apache cannot be started with those settings.

I then changed the port to 80, and apache started, but i encountered other problems when trying to load the ecommerce site from localhost.

Can you tell me a way I can run ssl on localhost so i can navigate to the https://localhost/checkout.php page and thus throughout the site please.


Thank you.




Link to comment
Share on other sites

Hmmm...this can be tricky. I'd start by re-evaluating whether it's really necessary to enable SSL on your Mac. Eventually I stopped bothering (I was never using real data that needed to be protected and since it's localhost, the data isn't leaving my computer regardless). 

But if you do want to continue the first trick is to figure out exactly why Apache doesn't like those settings. I normally start with Apache's "configtest" command, but you'll need to run that using MAMP's Apache. For the Mac's primary Apache you'd run `apachectl configtest`. Unfortunately I don't know what the properly path is to use MAMP's Apache instead, so you'll need to figure that out. 

Once you do that, `configtest` should give a specific error that can help debug this properly. 

Link to comment
Share on other sites


  • Create New...