Forked from raphaelstolt/php54_php53_pear_macports.markdown
Last active
December 29, 2015 11:49
-
-
Save mitchkramez/7665948 to your computer and use it in GitHub Desktop.
Guide to setting up macports LAMP stack with PHP 5.3 and 5.4 available to switch out depending on needs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Given | |
Apache 2 and MySQL are already installed. | |
#Update MacPorts | |
sudo port selfupdate;sudo port -u upgrade outdated | |
#Install PHP 5.4.* | |
sudo port install php54 php54-apache2handler | |
##Activate Apache Module | |
cd /opt/local/apache2/modules | |
sudo /opt/local/apache2/bin/apxs -a -e -n php5 mod_php54.so | |
##Install your needed extensions | |
sudo port install php54-curl php55-posix php54-ftp php54-iconv php54-mbstring php54-mcrypt php54-mysql php54-openssl php54-soap php54-sqlite php54-xsl php54-zip php54-gd php54-imagick php54-gettext php54-memcache php54-memcached php54-geoip | |
#Install PHP 5.3.* | |
sudo port install php53 php53-apache2handler | |
##Install your needed extensions | |
sudo port install php53-curl php53-ftp php53-iconv php53-mbstring php53-mcrypt php53-mysql php53-openssl php53-soap php53-sqlite php53-xsl php53-zip php53-gd php53-imagick php53-gettext php53-memcache php53-memcached php53-geoip | |
#Activate PHP 5.4.* | |
sudo port select php php54 | |
#Fall back to PHP 5.3.* when required | |
sudo port select php php53 | |
The *current* php_select doesn't change the **LoadModule** directive in your http.conf so you might have to change the version by hand (and restart your Apache). | |
//i generally ignore this part | |
#Install PEAR | |
cd # | |
curl http://pear.php.net/go-pear.phar -o go-pear.phar | |
sudo php go-pear.phar | |
Modify the PEAR install process to your needs; mine were the following: | |
1. Installation base ($prefix) : /opt/local/lib/php54 | |
... | |
4. Binaries directory : /opt/local/bin | |
... | |
##Check the PEAR installation, cleanup and install your favourite packages | |
pear info pear && rm go-pear.phar | |
sudo pear config-set auto_discover 1; sudo pear install pear.phpunit.de/PHPUnit | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment