The FC6 system successfully installs Apache + PHP + Mysql.

Source: Internet
Author: User
The FC6 system successfully installs Apache + PHP + Mysql process-Linux Enterprise Application-Linux server application information. The following is a detailed description. Environment: FC6, not upgraded. It is installed on a DVD on the official website. Including apache, php, and mysql are all built-in rpm packages on the CD.

Steps:

1. Install the httpd-2.2.3-5.i386.rpm package that comes with the CD, is apache, if the installation process prompts what other packages, see the prompt installed.

2. Then install the disc comes with the php-5.1.6-3.i386.rpm package, will prompt the need for other packages, installed.

3. Use vi to edit the/etc/httpd/conf/httpd. conf file and add

LoadModule php5_module/usr/lib/httpd/modules/libphp5.so this is to add a module information to apache. apache can support php and add

AddType application/x-httpd-php. php this is to enable apache to support files ending with. php, that is, php

Modify the servername option, remove the previous #, and get your favorite name. I used 127.0.0.1.

4. Edit the test. php file and store it in/var/www/html. The content is as follows;

    Phpinfo ()
?>

This is to test whether php is successfully installed.

5. Start the apache service:

Service httpd start

6. Open firefox and enter 127.0.0.1/test in the address bar. php: Press enter. You will see the relevant information about php, proving that apache and php are basically installed, but they are only basic. You can view other functions on your own. Note that mysql has not been installed yet, and the php information does not contain mysql information. Then, start to install mysql.

7. Install the mysql-5.0.22-2.1.i386.rpm package, the same, the prompt is poor, install, and then modify the/etc/php. ini file, find the mysql information, modify the attributes:

Mysql. default_port = change this value to 3306. This is the port option used by mysql.
Mysql. default_host = it is best to change it to localhost,
Mysql. default_user = root
Mysql. default_password = I wrote 111111

8. Install the mysql-server-5.0.22-2.1.i386.rpm package, this package is to make mysql a service, I think it is very good, not installed will cause a lot of trouble.

9. At this point, we have finished editing the mysqltest. php file with the following content:

    $ Link = mysql_connect ('localhost', 'root ','');
If ($ link) echo "yes ";
Else echo "no ";
Mysql_close ();
?>

Put it in/var/www/html, and enter 127.0.0.1/mysqltest in firefox. php, you will see yes, indicating that mysql is also installed. At this time, enter 127.0.0.1/test. php, you will find that the information contains a part of mysql, indicating that apache + php + mysql is successfully installed!

10. Success!

In this article, I have read the configuration files of other netizens and tried them by myself, for example, php and apache integration. I would like to thank them. Although I can't remember the name, some of them are purely original, thank you for your support. If you have any errors, please correct them!
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.