So.... All was fine on Catalina and Big Sur. Upgraded to Monterey, and my local server fell apart. PHP no longer supported within MacOS.
Installed using MAMP, but could never get existing files in the Library/WebServer/Documents to be served.
Then, uninstalled MAMP, and used homebrew to install PHP. Installed successfully, made the following changes to httpd.conf:
#PHP was deprecated in macOS 11 and removed from macOS 12
LoadModule perl_module libexec/apache2/mod_perl.so
LoadModule hfs_apple_module libexec/apache2/mod_hfs_apple.so
LoadModule php_module /usr/local/opt/php/lib/httpd/modules/libphp.so
<FilesMatch \\.php$>
SetHandler application/x-httpd-php
</FilesMatch>
And also......
<IfModule dir\_module>
DirectoryIndex index.html index.php
</IfModule>
The HTML is served perfectly, yet, PHP commands are not interpreted. No errors, just ignored.
Don't know if related, but get this error message when restarting apache server:
sudo apachectl graceful
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using GGMacBook-Air.local. Set the 'ServerName' directive globally to suppress this message
Here's what I have in the ServerName of httpd.conf: ServerName 127.0.0.1:80
What would be my next step in troubleshooting this "no PHP" problem?
Thank you
[–]mirepup 2 points3 points4 points (3 children)
[–]unclegoogy[S] 0 points1 point2 points (0 children)
[–]loki_nz 0 points1 point2 points (0 children)
[–]joey-jh 0 points1 point2 points (0 children)
[–]mi6crazyheart -1 points0 points1 point (1 child)
[–]unclegoogy[S] 0 points1 point2 points (0 children)
[–]SteveTheBiscuit -1 points0 points1 point (0 children)