CentOS Install Lamp (Linux + Apache + PHP) and install phpMyAdmin

Source: Internet
Author: User

Source: http://www.laozhe.net/302.html

In general, the installation is the latest official version, unless you have special needs, to install the specified version, this article is not discussed. From the very beginning of the basics, a little bit to complete an available Linux host. Here's how to install the LAMP component on CentOS 6.0. After installing the following statement, the currently installed version is:

php:5.3.2
apache:2.2.15
mysql:5.1.52



First, install MySQL



Start with the MySQL installation. Open HyperTerminal and enter:

1 yum installmysql mysql-server



The installation is complete so that MySQL can start automatically with the system:

12 chkconfig --levels 235 mysqld on/etc/init.d/mysqldstart



To set the password for the MySQL data root account:

1 mysql_secure_installation



Press ENTER directly when prompted as follows:

Enter Current password for root



Appear as follows to enter again:

Set root Password? [y/n]



The following prompts you to enter the password you need to set, enter after entering the confirmation:

New Password:



Then there will be four confirmations, namely:


    • Remove anonymous users? [y/n]


    • Disallow Root login remotely? [y/n]


    • Remove test database and access to it? [y/n]


    • Reload privilege tables now? [y/n]



You can enter directly.

Second, install Apache components



Since CentOS has encapsulated Apache, run the installation directly:

1 yum installhttpd



Also configure the system to allow Apache to boot with the system:

1 chkconfig --levels 235 httpd on



After configuration, start Apache:

1 /etc/init.d/httpdstart



Now that you have access to your server, you can see the test page "Apache 2 test page powered by CentOS", without any surprises. Note that if the other machine accesses the service and cannot display this page, it can be accessed directly on this server, which is normally forbidden by the CentOS-brought firewall. You only need to enter the firewall, the "WWW" corresponding to the "80" port to open.



Note: The default root directory for Apache in CentOS is/var/www/html, configuration file/etc/httpd/conf/httpd.conf. Other configurations are stored in the/etc/httpd/conf.d/directory.

Third, install PHP



Enter the following command to install PHP:

1 yum installphp



The Apache service needs to be restarted:

1 /etc/init.d/httpdrestart



Iv. Testing PHP Related information



This step can actually be omitted, but in order to test whether the installation is successful, you can create a new PHP page to test and create a new one using the VIM editor:

1 vi/var/www/html/info.php



Press "I" key to edit, enter:

123 <?phpphpinfo();?>



After editing, press "ESC" key to exit edit mode, then enter:

1 :wq



Then enter, save and exit.

At this point you can access your site address, such as "http://192.168.1.2/info.php", to see if you can see the relevant PHP information.



Seeing this diagram shows that the PHP installation was successful.

V. Linking the PHP module with the MySQL module



You also need to associate PHP with MySQL in order to work properly. Search module:

1 yum search php



To install the relevant modules:

1 yum installphp-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc



The Apache module needs to be restarted to take effect:

1 /etc/init.d/httpdrestart



Refresh the "info.php" page you just created, and pull down to find the relevant MySQL module to see if the relevant information is detected.



If you see information like this, it means that MySQL is working properly.

Installation: phpMyAdmin

Source: http://jingyan.baidu.com/article/86fae3468678533c48121a62.html

Can be downloaded under window through my Baidu Cloud phpMyAdmin, version 4.05 full-language version

Link Address: http://pan.baidu.com/share/link?shareid=3747011120&uk=3003518191

1. You can download and upload the file to CentOS via the link winscp

2. Change phpMyAdmin to the name you want, like pmn.tar.gz.

3. Then move the file to the Centos/var/www/html directory and start the terminal (Shell terminal)

Input cd/var/www/html

Tar Xvfz pmn.tar.gz

4. Install and unzip, change the folder name to PMN

5. Then enter the CD PMN under Terminal

6. Rename the config.sample.inc.php to config.inc.php under PMN (both extracted phpMyAdmin folder)

7. Copy the sample configuration file to the config.inc.php file

Enter the CP config.sample.inc.php config.inc.php under terminal

8. Restart Apache

Enter the service httpd under terminal restart

9. Enter 127.0.0.1/pmn/in the browser to browse and access the

CentOS Install Lamp (Linux + Apache + PHP) and install phpMyAdmin

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.