MySQL Apache php rpm installation procedure under Linux
1. Install the CD-ROM with the httpd-2.2.3-5.i386.rpm This package, is Apache, if prompted to install the process of what other packages, look at the hint loaded on.
2. Then install the CD-ROM with the php-5.1.6-3.i386.rpm This package, will be prompted to require additional packages, installed.
3. Edit/etc/httpd/conf/httpd.conf This file with VI and add
LoadModule php5_module/usr/lib/httpd/modules/libphp5.so This is to add a module information to Apache inside, is Apache can support PHP, and add
AddType application/x-httpd-php PHP This is to enable Apache to support files that end in. PHP, which is supported by PHP
and modify servername This item, the previous # removed, and then the name of your IP, (if only a single, 127.0.0.1)
4. Edit the test file test.php, stored in the/var/www/html, the contents are as follows;
<?php
Phpinfo ()
?>
This is to test if PHP is installed successfully.
5. To start the Apache service:
Service httpd Start
6. Open Firefox, in the address bar input 127.0.0.1/test.php, enter, you will see the relevant information of PHP, to prove that both Apache and PHP are basically installed, but only the basic, the other features to see you yourself. Note that, at this point, MySQL is not loaded, PHP information does not have MySQL information, and then began to install MySQL
7. Install mysql-5.0.22-2.1.i386.rpm This package, the same, prompt for what, install, and then modify the/etc/php.ini file, find the MySQL section of information, modify its properties:
Mysql.default_port= to change this to 3306, which is the option for MySQL to use what port
mysql.default_host= better change to localhost,
mysql.default_user= General Write Root
mysql.default_password= Fill in a password
8. Install mysql-server-5.0.22-2.1.i386.rpm This package, this package is to let MySQL become a service, I feel very good, do not install will be a lot of trouble. Start MySQL can use sevice mysqld start
9. Yum Install Php-mysql,
After opening/etc/php.ini, add the following two lines
Extension=mysql.so
Extension=mysqli.so
And then restart Apache.
Service httpd Restart
10. At this point, you are done, edit the mysqltest.php file with the following:
<?php
$link =mysql_connect (' localhost ', ' root ', ');
if ($link) echo "yes";
else echo "no";
Mysql_close ();
?>
Put to/var/www/html under, in Firefox input 127.0.0.1/mysqltest.php, will see Yes appears, indicating that MySQL also installed, this time, and then input 127.0.0.1/ test.php, you will find that the information is more part of MySQL.
Linux installation Apache/php/mysql