Build Apache + MySQL + PHP in centos

Source: Internet
Author: User

1. Environment

Host environment: ubuntu10.10

Virtual Machine: virtualbox 3.2.8

Centos version: cenos 5.4 (:Http://www.verycd.com/topics/2776496/)

Software Installation is all the yum commands that come with the system.


2. the VM installation process is very simple. I Want To Know About Baidu.


3. Install MySQL

Terminal code: Yum install MySQL mysql-Server

Set MySQL to boot: chkconfig -- levels 235 mysqld on

Start MySQL service:/etc/init. d/mysqld start

Set the MySQL connection password:Mysqladmin-u Root Password thepassword


4. install Apache

Terminal code: Yum install httpd

Set boot start: chkconfig -- levels 235 httpd on

Start Apache:/etc/init. d/httpd start

After accessing 127.0.0.1, you can see that Apache is successfully started:


5. Build a PHP Environment


Terminal command: Yum install PHP

Restart Apache:/etc/init. d/httpd restart



6. Connection between PHP and Apache


Terminal command: Yum search PHP (find the package to be installed)

Terminal command: Yum install PHP-mysql PHP-Gd PHP-imap PHP-ldap php-odbc php-pear PHP-xml php-XMLRPC

Restart Apache:/Etc/init. d/httpd restart


7. Check whether the operation is successful.


Create info. php under/var/www/html/. The content is as follows:

<? PHP

Phpinfo ()

?>

Browse: 127.0.0.1/info. php to view the connection status,



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.