Based on the instructions provided by Gilles Fabio I’ve created a complete installation script to install Apache 2, MySQL 5, PHP 5.3 and phpMyAdmin 3.5.4 for Mac OS X using MacPorts.
It’s important to know that as MacPorts compiles all the ports from source you have to have installed “Command Line Tools” (download it from http://connect.apple.com/, an Apple ID is needed) and once installed run xcodebuild -license
from the command line to accept the EULA.
It automatically installs and configures everything you need to have a working Apache+MySQL+PHP environment. Once installed the most important files can be located here:
httpd.conf: /opt/local/apache2/conf/httpd.conf httpd-vhosts.conf: /opt/local/apache2/conf/extra/httpd-vhosts.conf htdocs folder: /opt/local/apache2/htdocs php.ini: /opt/local/etc/php5/php.ini config.inc.php: /opt/local/apache2/htdocs/phpmyadmin/config.inc.php my.cnf: /opt/local/my.cnf mysqld.sock: /opt/local/var/run/mysql5/mysqld.sock
You can download it from my Github repository: installMacPorts-Apache-MySQL-PHP-phpMyAdmin-OSX.sh
Look at my article about how to configure the virtual hosts so you can have multiple websites in the same server.
UPDATE: You can install PHP 5.4 using this guide: https://gist.github.com/2721719
5 Comments.