PHP is not running on MacOS Monterey on Apple Macbook Pro M1

PHP is removed when I upgraded my Macbook Pro M1 from Big Sur to Monterey. Apache web server is still running though.

This solution doesn’t work! I blog it as reference for others that it doesn’t work so they can try another solution.

I’m still figuring it out. 🙂

My phpMyAdmin is showing its PHP Code

phpMyAdmin shown in plaintext in macos monterey
phpMyAdmin shown in plaintext in macos monterey

Install Rosetta2

Install PHP

Link the PHP

Check if PHP is installed

if correctly installed, you will see

Location of php.ini

Edit Apache httpd.conf

Change These Settings inside httpd.conf

 

References:

https://laracasts.com/discuss/channels/servers/php-shown-as-plaintext-mac-monterey

https://getgrav.org/blog/macos-monterey-apache-multiple-php-versions

https://stackoverflow.com/questions/64963370/error-cannot-install-in-homebrew-on-arm-processor-in-intel-default-prefix-usr