Change between multiple versions of PHP with Apache in Mac Ports

If you have for example 2 different versions of PHP in the same machine you can switch between them by just using APache eXtenSion tool:

For example to enable PHP 5.4:

$ cd /opt/local/apache2/modules
$ sudo /opt/local/apache2/bin/apxs -a -e -n php5 mod_php54.so

To enable PHP 5.6:

$ cd /opt/local/apache2/modules
$ sudo /opt/local/apache2/bin/apxs -a -e -n php5 mod_php56.so

To enable PHP 7.0:

$ cd /opt/local/apache2/modules
$ sudo /opt/local/apache2/bin/apxs -a -e -n php7 mod_php70.so

apache_logo

You might also like

Remove old Linux kernels in Ubuntu
As time goes new kernel versions are released. After a kernel update old installed versions are not removed...

Install PHP 7.0 in Mac OS X with MacPorts
I've used this process to install PHP 7.0 with MacPorts along side with PHP 5.6.First make sure Mac...

Select different available java and javac versions in Ubuntu with update-alternatives
It's possible to have more than one version of Java in the same machine.If you have more than...

Select different available java and javac versions in Ubuntu with update-alternatives
It's possible to have more than one version of Java in the same machine.If you have more than...

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.