Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sudo apachectl start not working on OS X Yosemite

I type in the command and i get this message

/System/Library/LaunchDaemons/org.apache.httpd.plist: Operation already in progress

So on safari i load the http://localhost page and it gives me the error message Safari can't connect to the server "localhost".

I'm new to this so don't have much knowledge on this but the reason i want to log in to this is to run my php scripts and test my websites on my laptop.

Ever since the os upgrade from mavericks to yosemite i couldn't run any php scrip.

like image 825
stringRay2014 Avatar asked Oct 20 '14 20:10

stringRay2014


3 Answers

First check config syntax

Run this command:

apachectl configtest

Check this post: http://mallinson.ca/osx-web-development/ (Section Apache, on yellow background you have info about OS X 10.10)

like image 99
kubens Avatar answered Nov 19 '22 08:11

kubens


I had to uncomment (remove the # character) the line "LoadModule php5_module..." in /etc/apache2/httpd.conf to re-enable PHP after upgrading, you may have to as well.

like image 29
robbymarston Avatar answered Nov 19 '22 08:11

robbymarston


run "sudo apachectl -k start", it works for me

like image 2
Paul Avatar answered Nov 19 '22 08:11

Paul