Reputation: 21
Mac OS 10.14 - Mojave:
can't run php web pages on Apache2 server:
Apache Logger file shows PHP module load:
[Sun Nov 04 01:15:44.594704 2018] [mpm_prefork:notice] [pid 31049] AH00163: Apache/2.4.34 (Unix) PHP/7.1.19 configured -- resuming normal operations [Sun Nov 04 01:15:44.594789 2018] [core:notice] [pid 31049] AH00094: Command line: '/usr/sbin/httpd -D SERVER_APP_HAS_DEFAULT_PORTS -D FOREGROUND'
$> php -v
on command line shows version 7.1.19:
PHP 7.1.19 (cli) (built: Aug 17 2018 18:03:17) ( NTS ) Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
Ideas?
Upvotes: 2
Views: 5957
Reputation: 11
Uncommenting the line:
LoadModule php7_module libexec/apache2/libphp7.so
at file /etc/apache2/httpd.conf, and restarting apache
apachectl restart
worked for me.
Upvotes: 0
Reputation: 61
I had to add this to private/etc/apache2/httpd.conf (or if you prefer into a .htaccess file, for an example ~/Sites/.htaccess).
# PHP 7 specific configuration
<IfModule php7_module>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
</IfModule>
Upvotes: 6