Install Tutorials
Apache, PHP, and MySQL are open-source software programs available free to download and install. Apache is a hosting server for sending webpages to the Internet. PHP is a server and scripting language for processing dynamic web applications. MySQL is a server and query language for database management.
Tutorials for installation and configuration are included for Mac OS X. Tutorials for Windows and Linux are not included, but can be found online.
Mac OS X 10.5 includes Apache 2.2.6 and PHP 5.2.4 (installed, but disabled by default). It is recommended to update for Mac OS X 10.4 or lower. MySQL 5.1.31 is currently available and will need to be installed.
Download and install PHP 5.2.4 (PPC and Intel)
- Go to www.entropy.ch/software/macosx/php
- Scroll down and click either "PHP 5.2.4 for Apache 1.3" or "PHP 5.2.4 for Apache 2"
- Save file to Desktop
- Open .tar.gz file with BOMArchiveHelper (not Stuffit Expander)
- Open .mpkg file and install/upgrade
Download and install MySQL 5.1.31
- Go to dev.mysql.com/downloads
- Click "Download" under the "MySQL Community Server" header
- Scroll down and click "Mac OS X (package format)"
- Click "Pick a mirror" for Mac OS X 10.4, (PowerPC, 64-bit)
(for Intel Version, click "Pick a mirror" Mac OS X 10.4 (x86))
(if running 10.5, follow steps for 10.5)
- Registering is not necessary. Click "No thanks"
- Locate and click "HTTP" mirror for nearest location
- Save file to Desktop
- Open .dmg file
- Open max .pkg package file and install/upgrade
- Open Startup .pkg package file and install/upgrade
(this will start MySQL when computer starts)
- Open .prefPane file and click "OK" to install in System Preferences
(Click MySQL icon in System Preferences to turn on or off)
- Put excess files on Desktop in Trash
- Go to Terminal in Applications/Utilities folder to verify installed versions
- Verify Apache version by entering httpd -v
- Verify PHP old version by entering php -v
- Verify PHP new version by entering /usr/local/php5/bin/php -v
- Verify MySQL version by entering /usr/local/mysql/bin/mysql --version
Configure PHP 5.2.4
- PHP configurations are in php.ini file
- Access file by entering cd /usr/local/php5/lib/
- View directory listing by entering ls
- Open and edit file in Terminal text editor by entering sudo nano php.ini
- Hit control-v on keyboard to go to Next Page
- Continue to "Error handling and logging" section
(the ; declares inactive lines of code)
- Verify error_reporting = E_ALL (default)
- Scroll using arrow keys to display_errors = Off
- Change to display_errors = On
- Hit control-x on keyboard to Exit
- Save changes by entering Y
- Hit return on keyboard to save as php.ini (default)
- Restart Apache to activate changes by entering sudo apachectl graceful
Configure MySQL 5.1.31
- Open Terminal to set a MySQL path
- Clear screen by entering clear
- Go back to main user root directory by entering cd ~
- Enter echo 'export PATH=$PATH:/usr/local/mysql/bin' >> ~/.bash_profile
- View the set path by entering cat .bash_profile
- Quit Terminal and reopen again
- Verify the set path by entering which mysql
- Set a root password by entering sudo mysql_secure_installation
- Enter user global password
- Create a root password for MySQL (case-sensitive)
- Enter Y to remove anonymous users
- Enter Y to disallow root login remotely
- Enter Y to remove test database and access to it
- Enter Y to reload privileges tables now
Configure Apache 1.3
- In System Preferences open the Sharing folder
- Select "Personal Web Sharing" and click "Start"
- Click "Stop" to turn Apache off
- Apache can be restarted in Terminal by entering sudo apachectl graceful
- Stop Apache by entering sudo apachectl stop
- Start Apache by entering sudo apachectl start
- View regular Apache configuration files by entering cd /private/etc/httpd
- View directory listing by entering ls
(httpd.conf is the main Apache configuration file)
Go to httpd.apache.org/docs/2.0/install.html for tutorials on how to install and configure Apache 2.0.