简体   繁体   中英

Unable to connect to apache on el capitan mac error AH00526: Syntax error on line 1 of -c/-C directives:

I recently upgraded to php56 on Mac OSX El Capitan. Now I am unable to run apache.

I am getting:-

This site can’t be reached
localhost refused to connect.

when trying to run localhost

apachectl -k restart command gives error saying

httpd not running, trying to start

When I run the command httpd -t -c httpd.conf, it throws the following error:-

AH00526: Syntax error on line 1 of -c/-C directives:
Invalid command 'httpd.conf', perhaps misspelled or defined by a module not included in the server configuration

apachectl configtest does not throw any errors. No logs in apache logs either.

Can anyone help me fix this. If you need any more details please tell me.

Got it. It was because httpd.conf was unable to load libphp5.so LoadModule php5_module libexec/apache2/libphp5.so If I comment this. Apache starts working.

But it should've logged in the errors. Don't know why it didn't log any error.

Still not able to figure out why libphp5.so doesn't work when it is in the right path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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