You are here

Install alternative version of php on a mac with mac ports

Wiki Terms: 

Note I've found all these directions on making it work even when installing port php52 it simply does not work. I'm still trying to get this to work. ack.

http://2tbsp.com/content/install_apache_2_and_php_5_macports
http://typofree.org/article/archive/2009/august/title/macports-give-me-b...
http://guide.macports.org/#development.local-repositories

If you need to uninstall MacPorts, and your port command is functioning, have it uninstall all the installed ports by typing this in the Terminal:


install php mysql with: sudo port install php52 +apache2 +php5-mysql +pear +php5-soap
uninstall with:  sudo port -f uninstall installed

-f is to force the install or uninstall.

to uninstall mac ports (this was the only way I could uninstall php 5.3)


sudo rm -rf \
    /opt/local \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0 \
    ~/.macports

Comments

Apparently, some of the MacPorts variants are incorrect. Specifically, the MySQL support variant is:

sudo port install php52 +apache2 +mysql5 +pear

To list all of the package port variables, do "port variants php52".

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer