How to install PHP and MySQL
How to install PHP and MySQL
2007/04
1) Test the installation:
To test, create a test file in the root of your web server:
Try to open this file called "test.php" from your local server and also from
another client machine to verify that PHP is working correctly
File “test.php” content:
<?php phpinfo() ?>
2) Configure the MySQL socket:
To change the location where MySQL creates its socket file, first create a backup of the mySQL config file, and then set the socket location:
cd /etc
sudo cp ./my.cnf ./my.cnf.default
sudo vi my.cnf
under the heading [mysqld] heading there is this line
socket=/var/mysql/mysql.sock
which needs to be chnaged to this
socket=/tmp/mysql.sock
3) Configure the PHP socket:
The default settings are in "php.ini-recommended"
cd /usr/local/php5/lib
sudo vi php.ini
under the heading [MySQL] heading there is this line
mysql.default_socket = /var/mysql/mysql.sock
which needs to be chnaged to this
mysql.default_socket = /tmp/mysql.sock
4) Setup the MySQL database:
To configure MySQL use the "MySQL Manager" located in the "/Applications/Server" directory:
As you may know, the MySQL database does not use the OSX userID's or passwords; because MySQL stores userIDs and passwords in its own MySQL database.
Therefore you must configure the MySQL root userID which is used to define new users and databases:
4.1) open the "MySQL Manager"
4.2) click the lock and enter your admin password
4.3) start the MySQL server
4.4) enter a "New MySQL root password" (Note: this is different from the OSX root password)
4.5) press TAB and re-type the password (using the mouse does not work)
4.6) press Enter to activate "Set Password" button
4.7) using the mouse, click on the "Set Password" button
5) More Links:
Installing PHP and MySQL
4/22/07
Download and run the Installer from the Enthropy web-site; Install PHP 5.2.1 for Apache 1.3. Note that PHP5 replaces PHP4 but OSX 10.4 comes with Apache 1.3 and not Apache 2.x.
If you enable the PHP4 plugin module for the web-server from Server Manager; the web server will restart and then stop (crash). If you have PHP5 installed; you do not need to enable the PHP5 plugin; the installer has already done this.