I have the opposite question from Why is the PHP version different in phpinfo() and CLI? My question is different from that one because I'm getting the expected PHP for the CLI and the wrong one for my local web server. Also, the solution offered there (changing the the path to the "LoadModule" in apache2/httpd.conf) does not work for me because the PHP version installed by brew has no analogous .so file to go in LoadModule.
I was running PHP 5.5 on Mac El Capitan. I am trying to run Craft CMS on my local machine, which requires mcrypt, which is installed with PHP 5.6 and above.
Using brew, I installed PHP 5.6. But when I run phpinfo(); in my Craft folder I am still on PHP 5.5.
If I go to the command line and say which php, I get:
php is /usr/local/bin/php
php is /usr/bin/php
php is /usr/local/bin/php
Then, /usr/local/bin/php -v gives me:
PHP 5.6.30 (cli) (built: Mar 11 2017 09:56:18)
and /usr/bin/php -v gives me:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so, 9): image not found in Unknown on line 0
PHP 5.5.36 (cli) (built: May 29 2016 01:07:06)
The only place I know PHP is called for the server is in etc/apache2/httpd.conf, where it's called by uncommenting LoadModule php5_module libexec/apache2/libphp5.so.
The brew PHP is in /usr/local/Cellar/php56, but there is no .so file there.
I also have homebrew.mxcl.php56.plistin ~/Library/LaunchAgents, copied from the brew install.
The php.ini file is still the same one from the etc folder.
What should I do to load the newer PHP 5.6 instead of the standard PHP 5.5?