After upgrading to Mac OSX Sierra from El Capitan as soon as I run php it denies to run any php project which was previously installed on my system.
That after exploring this issues on internet I came with these options...
After running the below commands:
sudo mv httpd.conf httpd.conf.sierra
sudo mv httpd.conf~previous httpd.conf
sudo cp php.ini-previous php.ini
sudo apachectl restart
; Directory in which the loadable extensions (modules) reside.
; extension_dir = "./"
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20121212/"
; extension_dl = On
; On windows:
; extension_dir = "ext"
I fixed my problem... To make mcrypt extension work (if you get an error after upgrading) Then follow this guide from scratch...
Please use the updated version of libmcrypt and php (php 5.6 - comes with OSX Sierra) from the mentioned guide (above).
And if your mysql stops working after folowing the above process (as it happened to me :( ), then just remove all the .err files from directory /usr/local/mysql/data and restart your mysql again for more info - see this
To Restart MySQL use this command
sudo /usr/local/mysql/support-files/mysql.server restart
Hope it helps you to upgrade your Mac OSX without any problems and saves your precious hours..!! :D