A few days ago I was update php through brew. Then apache2 was dead. And then there’s an odd issue which is no error log show me in error file. finally google tell me how to track error in CLI. It’s just soooo easy. When you start you apache server, only thing you do is that append some parameter. [-e DEBUG]. You see so easy.

sudo apachectl -k start -e DEBUG

then you will see something like this below

> sudo apachectl -k start -e DEBUG Password: [Fri Feb 26 10:31:06.062695 2016] [so:debug] [pid 3754] mod_so.c(266): AH01575: loaded module authn_file_module from /usr/libexec/apache2/mod_authn_file.so [Fri Feb 26 10:31:06.063281 2016] [so:debug] [pid 3754] mod_so.c(266): AH01575: loaded module authn_core_module from /usr/libexec/apache2/mod_authn_core.so … … … [Fri Feb 26 10:31:06.081539 2016] [so:debug] [pid 3754] mod_so.c(266): AH01575: loaded module alias_module from /usr/libexec/apache2/mod_alias.so [Fri Feb 26 10:31:06.081962 2016] [so:debug] [pid 3754] mod_so.c(266): AH01575: loaded module rewrite_module from /usr/libexec/apache2/mod_rewrite.so httpd: Syntax error on line 170 of /private/etc/apache2/httpd.conf: Cannot load /usr/local/Cellar/php56/5.6.17/libexec/apache2/libphp5.so into server: dlopen(/usr/local/Cellar/php56/5.6.17/libexec/apache2/libphp5.so, 10): image not found

Let’s focusing on last line, we can figure out that’s why my apache cant startup. then. just vim httpd.conf. Changing 5.6.17 to 5.6.18. EOF.