I'm all out of whack on my mac apache setup. I ran a tutorial that suggested Brew before I realized Mojave already preinstalls apache. Now no php files load
When I run which httpd
I get this result:
/usr/local/bin/httpd
This command ps -aef | grep httpd
Produces this:
0 69773 1 0 12:59PM ?? 0:00.51 /usr/local/opt/httpd/bin/httpd -k start
70 75531 69773 0 5:00PM ?? 0:00.01 /usr/local/opt/httpd/bin/httpd -k start
70 75532 69773 0 5:00PM ?? 0:00.00 /usr/local/opt/httpd/bin/httpd -k start
70 75533 69773 0 5:00PM ?? 0:00.00 /usr/local/opt/httpd/bin/httpd -k start
70 75534 69773 0 5:00PM ?? 0:00.00 /usr/local/opt/httpd/bin/httpd -k start
70 75535 69773 0 5:00PM ?? 0:00.02 /usr/local/opt/httpd/bin/httpd -k start
70 75537 69773 0 5:00PM ?? 0:00.00 /usr/local/opt/httpd/bin/httpd -k start
70 75538 69773 0 5:00PM ?? 0:00.00 /usr/local/opt/httpd/bin/httpd -k start
70 75539 69773 0 5:00PM ?? 0:00.00 /usr/local/opt/httpd/bin/httpd -k start
501 75680 89456 0 5:08PM ttys002 0:00.00 grep httpd
which indicates that my apache is running. From questions on the similar issue I've seen it says that I need to uncomment the LoadModule for PHP however in my config there is no LoadModule for php. Nothing in httpd.conf
says anything about php. I manually changed or added this:
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule
#Stackoverflow answer
<FilesMatch .php$>
SetHandler application/x-httpd-php
</FilesMatch>
But this line is nowhere to be found:
LoadModule **php7_module** libexec/apache2/**libphp7.so**
According to php -v
Php is loaded and running thou.
PHP 7.2.8 (cli) (built: Jul 19 2018 12:14:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.8, Copyright (c) 1999-2018, by Zend Technologies
When I go to localhost it resolve. However the php page that appears is just the code so it's not rendering the php page.
It appears the source of my httpd.conf is this:
/usr/local/etc/httpd/httpd.conf
LoadModule php7_module libexec/apache2/libphp7.so
I get an error
httpd: Syntax error on line 182 of /usr/local/etc/httpd/httpd.conf: Cannot load libexec/apache2/libphp7.so into server: dlopen(/usr/local/opt/httpd/libexec/apache2/libphp7.so, 10): image not found