Linux built under the lamp environment Yum

Source: Internet
Author: User
Tags phpinfo
Organize your recent experience of building lamp

    • VMware version number: 11.1.2

    • CentOS Version: 6.6

Installing Apache

1. Installing Apache

 yum -y install httpd

2. Apache Configuration httpd.conf

    • find / -name httpd.confFind Apache configuration file by command httpd.conf (default in/etc/httpd/conf/httpd.conf)

    • Edit httpd.conf File

        vi /etc/httpd/conf/httpd.conf

      Modify DocumentRoot "/xx/xx/xxx" , in which directory the project will be "/xx/xx/xxx" changed to which directory, for example DocumentRoot "/var/www/html" , will also be modified to .

    • See if 成功 the installation (boot Apache , and view Apache status)

        service httpd start  service httpd status

Display OK Description安装成功

    • ConfigurationApache开机启动项

         chkconfig --add httpd (在服务清单中添加httpd服务)   chkconfig httpd on   

Install MySQL

1. Install MySQL

yum -y install mysql mysql-devel mysql-server mysql-libs

2. View MySQL version

rpm -qi mysql-server

3. Database Character Set settings

    • Mysql/etc/my.cnfin the configuration file, adddefault-character-set=utf8

4. Start MySQL

service mysqld start

5. Create the root administrator

mysqladmin -u root password 密码

6. Configure MySQL Boot service

 chkconfig --add mysqld  (在服务清单中添加mysql服务) chkconfig mysqld on     

7. Log in to MySQL

mysql -u root -p 回车输入密码

Install PHP

1. Install PHP

yum -y install php

2. Installing PHP Extensions

yum -y install php-mysql php-gd php-imap php-ldap php-odbc php-mbstring php-devel php-soap php-cli php-pdo    yum -y install php-mcrypt php-tidy php-xml php-xmlrpc php-pearyum -y install php-pecl-memcache php-eaccelerator

3. Restart Apache

service httpd restart

4. Testing

    • /var/www/html/under Create index.php file, and writephpinfo()

    • The browser accesses the index.php file, if phpinfo the output information,安装成功

The above describes the Linux built lamp environment yum, including Apache, the installation of Apache content, I hope the PHP tutorial interested in a friend helpful.

  • 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.