PHP is not running after upgrade MacOS Big Sur on Apple Macbook Pro M1

Macos Bigsur upgrade php not running

Another problem I always face after upgrading MacOS where PHP is not running anymore. I have to google to find solution. Now I decided to write step by step tutorial so easy for my future reference and hopefully can help others who face the same thing.

1) My phpMyAdmin instead of showing login page, it displays its PHP code.

Macos Bigsur upgrade php not running
Macos Bigsur upgrade php not running

2) Uncomment PHP Module

Open httpd.conf

Find php by typing

Remove # to uncomment the PHP module.

remove # from load module php
remove # from load module php

Save the changes by typing

3) Restart Apache

4) Refresh the PHP page

macos big sur php running again after change httpd conf
macos big sur php running again after change httpd conf