Lamp Environment Construction

Source: Internet
Author: User

This week to try to build the lamp environment, although encountered problems, stumbled, basically completed the building.


First, Understand:

1,LAMP is Linux(operating system) +Apache(Web server Software) +MySQL(database) +PHP(programming language) architecture abbreviation. (Note: M sometimes also represents mariadb;p sometimes on behalf of Perl or Python)


2. Users can develop websites in this environment. The four components of lamp are open source, so the combination has been greatly welcomed.


Second, Action:

1. Install Apache:

Yum install httpd #按提示输入y即可

/ETC/INIT.D/HTTPD Start #启动Apache

2. Install MySQL:

① Installing mSQL:

yum MySQL mysql-server  

/etc/init.d/mysqld Start #启动MySQL
Chkconfig mysqld on #设为开机启动
CP/USR/SHARE/MYSQL/MY-MEDIUM.CNF/ETC/MY.CNF #拷贝配置文件(Note: If the/etc directory has a my.cnf under the default, you can directly overwrite it)

② to set the password for the root account:

Input: Mysql_secure_installation, follow the prompts two times to enter the password until the setup is complete.

3. Install PHP:

① Installing PHP:

Yum Install PHP

② Install the configuration file to support MySQL:

Yum Install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt p Hp-bcmath Php-mhash Libmcrypt

/etc/init.d/mysqld Restart #重启MySql
/etc/init.d/httpd Restart #重启Apache

4. Test:

Cd/var/www/html
VI index.php #按i进入编辑模式, enter the content below
<?php
Phpinfo ();
?>
: wq! #保存退出

Enter the server IP address in the client browser, visible:

650) this.width=650; "title=" 1.png "src=" Http://s3.51cto.com/wyfs02/M01/56/C0/wKiom1SMN1rw31cNAAGlhNOXobw852.jpg " alt= "Wkiom1smn1rw31cnaaglhnoxobw852.jpg"/>



Third, I encountered the problem:

1, the use of yum command always download failure, puzzled for a long time, finally found that there is no internet, and really solved the good.

2. When you start Apache, you cannot find the httpd file in Init.d, you can use the which command to find its location---"which httpd", as well as other files.



Lamp Environment Construction

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.