Linux 6 under Yum mode installation configuration lamp platform

Source: Internet
Author: User
Tags php and mysql phpinfo zts

Linux under the building lamp is a classic no longer a classic small and medium-sized enterprise site building platform. Its full name is linux+apache+mysql+php, often used to build dynamic Web site, itself is a separate program, but because often put together to use, has a higher degree of compatibility, together constitute a powerful Web application platform. Therefore, there is a one-click installation solution on the network than the name of the famous lamp. For OPS, however, it is important to understand the installation process that it has completed. This article describes the use of the Yum method to quickly build a lamp platform based on CentOS 6 (Linux installation ignored).

First, prepare the Yum source (this article uses 163 mirrors)

# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo -P /etc/yum.repos.d/# yum clean all# yum makecache

Second, install Apache httpd

For more information: Install Apache under Linux httpd

# # #检查是否已安装httpd# rpm-qa|grep httpdhttpd-tools-2.2.15-45.el6.centos.x86_64httpd-2.2.15-45.el6.centos.x86_64# yum-y Install httpd # # #此时我们看到httpd的小版本从45变成了53# rpm-qa|grep httpdhttpd-tools-2.2.15-53.el6.centos.x86_64httpd-2.2.15-53.el6.centos.x86_64# # #查询生成的相关配置文件# RPM-QC Httpd|grep conf/etc/httpd/conf.d/welcome.conf/etc/httpd/conf/httpd.conf/etc/httpd/conf/magic/etc/sysconfig/htcacheclean/etc/sysconfig/httpd# # #启动httpd#/etc/init.d/httpd Startstarting httpd: [OK]# Netstat-nltp|grepTCP 0 0::: +:::* LISTEN 7621/httpd# # #验证web服务# curl-i http://localhosthttp/1.1 403 Forbiddendate:tue, 09:25:15 GMTserver:apache/2.2.15 (CentOS)accept-ranges:bytescontent-length:4961Connection:closecontent-type:text/html; Charset=utf-8# # #编写一个php页面测试# echo ">>

This is a PHP test page.

> > Phpinfo (); >?> > ">>/var/www/html/index.php # # #测试结果为phpinfo函数没有被解释 # Curl Http://localhost/index.php

This is a PHP test page.

phpinfo (); ?>

Third, install PHP

# # #安装php, also installs the dependent package# yum Install phpinstalling:php x86_645.3. 3-.EL6 Base1.1M installing forDEPENDENCIES:PHP-CLI x86_645.3. 3-.EL6 Base2.2M Php-common x86_645.3. 3-.EL6 Base530K# # #查看php安装清单# rpm-ql PHP/etc/httpd/conf.d/php.conf/usr/lib64/httpd/modules/libphp5.so/var/lib/php/session/var/www/icons/php.gif# # #查看php的配置文件# grep-ve "^#|^$"/etc/httpd/conf.d/php.conf        
  
   
    LoadModule php5_module modules/libphp5.so
   
          
  
   
    LoadModule php5_module modules/libphp5-zts.so
   
  AddHandler php5-script. php addtype text/html. php directoryindex index.php# # #在上面的配置文件中, since PHP works in a modular manner with httpd, according to HTTPD's MPM mode,# # #其所需要的php模块格式有所不同; prefork mode uses the LIBPHP5 module worker and event mode using the Libphp5-zts module# # #重启httpd已使得php模块生效#/etc/init.d/httpd ConfigtestSyntax OK#/etc/init.d/httpd Restartstopping httpd: [OK] Starting httpd: [OK]# # #验证php模块已经被加载# httpd-m |grep phpPhp5_module (Shared)# # #验证php页面# Curl Http://localhost/index.php|more                

This is a PHP test page.

Public"-//W3C//DTD XHTML 1.0 transitional//en""Dtd/xhtml1-transitional.dtd">

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.