Apache 2 + MySQL 5 + PHP 5.3 + phpMyAdmin 3.5.4 installation script for Mac OS X using MacPorts

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

You might also like

Useful Apache 2 and MySQL 5 service aliases for MacPorts
Those are some aliases I use to start, stop and restart Apache 2 and MySQL on my MacPorts installation...
Change root password in MySQL
In GNU/Linux: $ sudo mysqld_safe --skip-grant-tables & $ mysql -u root -p #press enter to use a...
Run shell commands in Mac OS X executing a normal application
Once I installed Apache2+MySQL5+PHP5.3 using MacPorts I wanted to start and stop the services without...
Using MacPorts php from command line
Some time ago I had installed Apache+MySQL using MacPorts in Mac OS X. It was all OK as long as I used...
Leave a comment ?


    Leave a Comment