Build PHP Environment lamp (linux+apache+mysql+php)

Source: Internet
Author: User
Tags install php phpmyadmin

1. Installing Apache

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

Apache Default program Directory is/var/www/html

2. Install MySQL

Yum-y install MySQL Mysql-server

Start MySQL with/etc/init.d/mysqld start

Mysql_secure_installation press ENTER to prompt to set the MySQL password until "Thanks for using mysql!" is displayed

3. Install PHP

Yum-y Install PHP

4. Startup settings

Service httpd Start

Service mysqld Start

Configuring HTTPD, Mysqld boot from

Chkconfig mysqld on
Chkconfig httpd on

5. Testing

New test.php in/var/www/html/

<? PHP  phpinfo ();

Access: localhost/test.php, display normal the lamp environment installation success

============================================

6. To facilitate the management of MySQL from the web, install phpMyAdmin

Yum-y Install PhpMyAdmin

Configure phpMyAdmin

Modify/etc/phpmyadmin/config.inc.php

$cfg ['Servers'[$i] ['Controluser']   ='Root';//MySQL Control user Settings//(This user must has read-only$cfg ['Servers'[$i] ['Controlpass']   ='xxxxxx';//access to the "Mysql/user"... $cfg ['Servers'[$i] ['User']          ='Root';//MySQL User$cfg ['Servers'[$i] ['Password']      ='xxxxxx';//MySQL password (only needed

Connect the phpMyAdmin installation path to the HTTPD service directory

Ln-s/usr/share/phpmyadmin/var/www/phpmyadmin

Modify/etc/httpd/conf.d/phpmyadmin.conf to modify "Deny from all" to "Allow from all"

<Directory/usr/share/phpMyAdmin/>Adddefaultcharset UTF-8<ifmodule mod_authz_core.c># Apache2.4<RequireAny>Require IP127.0.0.1Require IP::1</RequireAny> </IfModule> <ifmodule!mod_authz_core.c># Apache2.2Order deny,allow   allow from   all allow from 127.0.0.1 Allow from::1</IfModule></Directory>

Open Http://localhost/phpmyadmin in the browser address bar

To this, the phpMyAdmin configuration is installed successfully!

Build PHP Environment lamp (linux+apache+mysql+php)

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.