MacOS – Can’t start PHP localhost

macososx-serverPHP

So i've done this before but I don't remember the command. I was able to use a directory a localhost file. I've tried sudo apachectl start but when I go to localhost the page isn't found. I've also tried restarting the server, but the result was still the same. Any ideas? I'm using OSX Mavericks

Best Answer

I think you have a problem with opening http://localhost ?

If I'm right you should check your httpd.conf:

Look for: Listen 80 <- This line should not be commented and make sure 80 is written ( when you write localhost into your browser, the browser checks the 80 port on default. )

If it's 80 then check your if your server root folder is OK:

Must be where the --prefix folder is : normally under /usr/local/apache2.x.x

Then you should check that the DocumentRoot points to the right folder (where your index.html is located if no index.html is present)