CentOS6 编译安装LAMP(Apache,Mariadb,php)_2015092001

httpd与php结合的方式有三种:

1、module:将php编译成httpd的模块,当Apache服务器收到客户端的动态资源请求时,httpd服务自身便可以依靠php模块来处理动态资源。

2、cgi:此种方式是当Apache服务器,每次收到客户端发来的动态资源请求时,将调用php生成一个子进程来处理客户端所请求的动态资源,因此n个请求便会在服务器端启动2n个进程,是对服务器资源极大程度的浪费,因此,此种结合方式很少用。

3、fpm:此种方式是基于fastcgi协议,php作为一个服务监听在某个套接字上,当Apache客户端解析到客户端所请求的资源是动态资源是,便将请求发送给php服务,由php服务处理动态内容,并响应给httpd服务,再由httpd服务将结果返回给客户端。此时的Apache服务器便是一个代理服务器。httpd2.4版本新增了一个mod_fcgi模块,此模块便是可让httpd与php基于fpm方式结合,httpd2.2版本若想基于fpm方式与httpd结合,需自行安装fcgi模块。

本机版本及IP地址信息:

[[email protected] ~]# uname -r
2.6.32-504.el6.x86_64
[[email protected] ~]# cat /etc/redhat-release 
CentOS release 6.6 (Final)
[[email protected] ~]# ip addr show | awk -F‘[ /]+‘ ‘/inet\>/&&!/127.0.0.1/ {print $3}‘
172.16.113.14

安装次序:

1、由于pgp与httpd若与模块方式结合,那么首先得现有httpd才能将php编译进httpd的内核

2、若编译php支持mariadb的驱动,首先需要知道Mariadb的安装位置及其版本,才能编译相应的驱动。

因此,编译次序为 httpd---- > MariaDB --- >php ,mariadb和httpd的安装次序不分前后。

a、关闭iptables    //若对iptables规则熟悉,可忽略此条信息

b、关闭selinux

        [[email protected] ~]# sed -i ‘s/\(SELINUX=\).\+/\1disabled/‘ /etc/sysconfig/selinux
        [[email protected] ~]# setenforce 0

c、准备开发环境(需提前配置好yum源)

Development tools

Server Platform Development

A、将php编译进httpd的模块,实现LAMP结合,并搭建phpMyadmin,实现数据库图形借口管理

需要的源码包:

1、httpd-2.4.9.tar.bz2----httpd的源码包,由Apache官网下载  http://www.apache.org/

2、php-5.6.4.tar.xz    -----php的源码包,有php官网下载        http://www.php.net/

3、mariadb-5.5.43-linux-x86_64.tar.gz  --- mariadb的二进制版本包,由mariadb官网下载https://downloads.mariadb.org/

4、apr-1.5.0.tar.bz2 和apr-util-1.5.3.tar.bz2  此为httpd的运行环境,httpd的安装需要依赖于apr(Apache portable Run-time libraries,Apache可移植运行库),实现httpd的跨平台运行。由于htpd2.4需要较高版本的apr及apr-util,所以需将其升级,可通过epel源升级或者源码升级。此处选择源码升级。

1、展开源码包到/usr/local/src

[[email protected] ~]# tar xf apr-1.5.0.tar.bz2 -C /usr/local/src/
[[email protected] ~]# tar xf apr-util-1.5.3.tar.bz2 -C /usr/local/src/
[[email protected] ~]# tar xf mariadb-5.5.43-linux-x86_64.tar.gz -C /usr/local/src/
[[email protected] ~]# tar xf php-5.6.4.tar.xz -C /usr/local/src/
 [[email protected] ~]# unzip phpMyAdmin-4.0.5-all-languages.zip -d /usr/local/src/

2、httpd在url重写时可能需要用到pcre来支持perl语言的正则表达式,安装过程中需要依赖pere-devel包,因此,先装上此包:

[[email protected] ~]# yum install -y pcre-devel    //需提前配置好yum源

3、安装apr及apr-util包

[[email protected] ~]# cd /usr/local/src/apr-1.5.0/    //切换至apr解压目录
[[email protected] apr-1.5.0]# ./configure --prefix=/usr/local/apr    //指明apr的安装位置
[[email protected] apr-1.5.0]# make && make install     //编译并安装
[[email protected] apr-1.5.0]# cd /usr/local/src/apr-util-1.5.3/    //切换至apr-util的解压目录
[[email protected] apr-util-1.5.3]# ./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr    //指定安装目录及apr路径
[[email protected] apr-util-1.5.3]# make && make install     //编译并安装

4、安装编译安装httpd

[[email protected] ~]# cd /usr/local/src/httpd-2.4.9/    //切换至httpd的解压目录
[[email protected] httpd-2.4.9]# ./configure --help    
//使用此选项查看编译时所支持的参数,由于条目过多,此处指选出需要用到的参数进行讲解
--prefix=/usr/local/apache    //指明安装目录
--sysconfdir=/etc/httpd24    //指定配置文件的安装路径,此处为了避免与rpm包所装的httpd冲
突,将路径名取名为httpd24
--enable-so         //支持httpd的模块化机制
--enable-ssl     //启用支持ssl功能,实现https
--enable-cgi     //支持cgi协议
--enable-rewrite     //支持url重写
--with-zlib     //支持传输压缩
--with-pcre     //支持perl语言的正则表达式
--with-apr=/usr/local/apr    //指明编译升级的apr的路径
--with-apr-util=/usr/local/apr-util //指明编译升级的apr-util路径
--enable-modules=most     //指明启动大多数的模块
--enable-mpms-shared=all     //将所有mpm模块都编译进httpd(httpd2.4版本的新特性)
--with-mpm=event    //默认使用event的MPM工作模型
[[email protected] httpd-2.4.9]# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-modules=most --enable-mpms-shared=all --with-mpm=event
[[email protected] httpd-2.4.9]# make && make install     //编译并安装

5、为编译安装的httpd添加环境变量

[[email protected] httpd-2.4.9]# vim /etc/profile.d/httpd24.sh    
//在/etc/profile.d/目录下创建一个以.sh结尾的文件,并编辑
export PATH=/usr/local/apache/bin/:$PATH    //将此信息添加至改文件,并保存退出
[[email protected] httpd-2.4.9]# source /etc/profile.d/httpd24.sh   
 //通知系统重新读取此文件
现在便可以直接使用编译安装的httpd命令了。

6、编译配置文件,添加pidfile文件路径

[[email protected] httpd-2.4.9]# vim /etc/httpd24/httpd.conf 
Pidfile "/var/run/httpd/httpd.pid"        //在配置文件中添加该行,并保存退出

7、为编译安装的httpd提供服务管理脚本,放置于/etc/rc.d/init.d下,名为httpd.24

# chkconfig: - 85 15
# description: The Apache HTTP Server Management script.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/httpd ]; then
        . /etc/sysconfig/httpd
fi
HTTPD_LANG=${HTTPD_LANG-"C"}
INITLOG_ARGS=""
apachectl=/usr/local/apache/bin/apachectl
httpd=${HTTPD-/usr/local/apache/bin/httpd}
prog=httpd
pidfile=${PIDFILE-/var/run/httpd/httpd.pid}
lockfile=${LOCKFILE-/var/lock/subsys/httpd}
RETVAL=0
STOP_TIMEOUT=${STOP_TIMEOUT-10}
start() {
        echo -n $"Starting $prog: "
        LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch ${lockfile}
        return $RETVAL
}
stop() {
        echo -n $"Stopping $prog: "
        killproc -p ${pidfile} -d ${STOP_TIMEOUT} $httpd
        RETVAL=$?                                                                                                                                                                  
        echo                                                                                                                                                                       
        [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}                                                                                                                            
}                                                                                                                                                                                  
reload() {                                                                                                                                                                         
    echo -n $"Reloading $prog: "                                                                                                                                                   
    if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then                                                                                                                     
        RETVAL=6                                                                                                                                                                   
        echo $"not reloading due to configuration syntax error"                                                                                                                    
        failure $"not reloading $httpd due to configuration syntax error"                                                                                                          
    else                                                                                                                                                                           
        # Force LSB behaviour from killproc                                                                                                                                        
        LSB=1 killproc -p ${pidfile} $httpd -HUP                                                                                                                                   
        RETVAL=$?                                                                                                                                                                  
        if [ $RETVAL -eq 7 ]; then                                                                                                                                                 
            failure $"httpd shutdown"            
        fi                                                                                                                                                                         
    fi                                                                                                                                                                             
    echo                                                                                                                                                                           
}                                                                                                                                                                                  
                                                                                                                                                                                   
# See how we were called.                                                                                                                                                          
case "$1" in                                                                                                                                                                       
  start)                                                                                                                                                                           
        start                                                                                                                                                                      
        ;;                                                                                                                                                                         
  stop)                                                                                                                                                                            
        stop                                                                                                                                                                       
        ;;                                                                                                                                                                         
  status)                                                                                                                                                                          
        status -p ${pidfile} $httpd                                                                                                                                                
        RETVAL=$?                                                                                                                                                                  
        ;;                                                                                                                                                                         
  restart)                                                                                                                                                                         
        stop                                                                                                                                                                       
        start                                                                                                                                                                      
        ;;                                                                                                                                                                         
  condrestart|try-restart)                                                                                                                                                         
        if status -p ${pidfile} $httpd >&/dev/null; then                                                                                                                           
                stop                                                                                                                                                               
                start                                                                                                                                                              
        fi                                                                                                                                                                         
        ;;                                                                                                                                                                         
  force-reload|reload)                                                                                                                                                             
        reload                                                                                                                                                                     
        ;;                                                                                                                                                                         
  graceful|help|configtest|fullstatus)                                                                                                                                             
        $apachectl [email protected]                                                                                                                                                              
        RETVAL=$?                                                                                                                                                                  
        ;;                                                                                                                                                                         
  *)                                                                                                                                                                               
        echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful|help|configtest}"                                           
        RETVAL=2                                                                                                                                                                   
esac                                                                                                                                                                                                                                                                                                                                      
exit $RETVAL

8、将httpd24添加至开机自动启动列表,脚本启动httpd,进行测试:

[[email protected] ~]# chkconfig --add httpd24
[[email protected] ~]# chkconfig --list httpd24
httpd24         0:off   1:off   2:on    3:on    4:on    5:on    6:off
[[email protected] httpd-2.4.9]# service httpd24 start
Starting httpd: AH00558: httpd: Could not reliably determine the server‘s fully qualified domain name, using localhost.localdomain. Set the ‘ServerName‘ directive globally to suppress this message    //此处报错可忽略
[  OK  ]
[[email protected] httpd-2.4.9]# ss -tnl | grep 80
LISTEN     0      128                      :::80                      :::*     //80端口已处于监听状态

9、安装mariadb:此安装过程可查看mysql的展开目录中的INSTALL-BINARY 文档

[[email protected] httpd-2.4.9]# cd /usr/local/src/       //切换至src的目录
[[email protected] src]# mv mariadb-5.5.43-linux-x86_64 /usr/local/mysql    
//将mariadb的目录名改为mysql
[[email protected] src]# groupadd -r -g 306 mysql    //添加mysql组为系统组
[[email protected] src]# useradd -r -u 306 -g 306 mysql    
//添加mysql用户为系统用户并添加至mysql组
[[email protected] src]# chown -R mysql:mysql mysql    
//将mysql目录及其子目录改为属主属组都为mysql
[[email protected] src]# mkdir /mydata/data -pv    
//创建mysql的数据库目录
mkdir: created directory `/mydata‘
mkdir: created directory `/mydata/data‘
[[email protected] src]# cd mysql/
[[email protected] src]# scripts/mysql_install_db --user=mysql --datadir=/mydata/data   
 //以mysql用户安装mariaDB并指明数据库目录位置

 [[email protected] mysql]# chown -R root .       //将mysql目录改为root属主
[[email protected] mysql]# mkdir /etc/mysql    //创建mysql配置文件目录
//mysql的配置文件查找顺序为:
/etc/my.cnf -- > /etc/mysql/*.cnf ---> --defaults-file(若编译安装时指定此项) 
---> ~/.my.cnf 启动mysql的用户家目录下,最后一个加载的配置参数覆盖前面的配置参数

[[email protected] mysql]# cp support-files/my-large.cnf /etc/mysql/my.cnf   
 //展开目录下support-files目录中提供有几个配置模板,依照内存需求命令,
 可根据需要拷贝为默认的配置文件

 [[email protected] mysql]# vim /etc/mysql/my.cnf    
//编辑配置文件,在[mysqld]容器中添加如下几个参数
thread_concurrency = 8      //将此项改为自己cpu核心数量的两倍
datadir = /mydata/data    //指明数据库目录
innodb_file_per_table = yes    //开启innodb数据库每个表存储为一个文件
skip_name_resolve = yes    //开启跳过名称自解析
[[email protected] mysql]# cp support-files/mysql.server /etc/rc.d/init.d/mysqld    
//提供服务管理脚本,此脚本为软件所提供

[[email protected] mysql]# chmod +x /etc/rc.d/init.d/mysqld    //将服务脚本赋予可执行权限
[[email protected] mysql]# chkconfig --add mysqld    //将mysqld添加至开机自动启动项
[[email protected] mysql]# chkconfig mysqld on    //开启开机自动启动
[[email protected] mysql]# chkconfig --list mysqld
mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off
[[email protected] mysql]# /etc/init.d/mysqld start    //启动mysqld服务
[[email protected] mysql]# bin/mysql_secure_installation    
 //运行mariadb的安全初始化,以完成为root用户添加密码以及其他的安全操作

 至此,mariadb已完成安装

10、编译安装php,将其安装为httpd的模块

[[email protected] php-5.6.4]# yum install -y libmcrypt-devel.x86_64 bzip2-devel    //在epel源中有提供

//解决依赖关系,php可能用到bzip2来进行数据的压缩
[[email protected] php-5.6.4]# yum install -y libxml2-devel    
//编译安装若启用对xml文档的支持,则需安装此项

[[email protected] mysql]# cd /usr/local/src/php-5.6.4/    //切换至php的展开目录
此处依旧可使用./configure --help 查看编译安装时所支持的参数
--prefix=/usr/local/php     //指明安装路径
--with-mysql=/usr/local/mysql     //指定mysql的位置
--with-openssl     //支持openssl
--with-mysqli=/usr/local/mysql/bin/mysql_config     //对mysql进行交互的另外一种接口
--enable-mbstring         //对多字节字符串支持,对中文支持,必须启用此项
--with-freetype-dir         //支持freetype字体格式
--with-jpeg-dir     //开启此功能,可以使用php直接处理jpeg格式的图片    
--with-png-dir     //   开启此功能,可以支持php直接处理png格式的图片
--with-zlib     // 支持zlip压缩,提高数据传输效率
--with-libxml-dir=/usr     //支持处理xml文档
--enable-xml      //启用xml功能
--enable-sockets     //表示支持php支持socket进行通信

--with-apxs2=/usr/local/apache/bin/apxs    //此项表示将php编译成模块

--with-mcrypt          //支持加密解密

--with-config-file-path=/etc     //指明php配置文件的放置位置

--with-config-file-scan-dir=/etc/php.d     //表示检索此位置下的.ini结尾的文件作为php的配置文件

--with-bz2      //支持bzip2格式的压缩

--enable-maintainer-zts    //若httpd以线程模式运行(worker或event)模式运行,此项必须!表示将php编译成zts模块

[[email protected] php-5.6.4]#./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml  --enable-sockets --with-apxs2=/usr/local/apache/bin/apxs --with-mcrypt  --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2  --enable-maintainer-zts

[[email protected] php-5.6.4]#make -j 4 && make install    //编译并安装。可使用-j n 指明使用几颗cpu核心进行编译,加速编译过程

./configure过程中,若出现错误,一般都是因为所依赖的*-devel包未安装,因此,使用yum install安装即可。

[[email protected] php-5.6.4]# cp php.ini-production /etc/php.ini

//提供php配置文件,此文件无需更改。

[[email protected] php-5.6.4]# vim /etc/httpd24/httpd.conf

//编辑httpd配置文件,找到php的模块,确保是否php已安装成功

添加如下几项:

    AddType application/x-httpd-php .php
    AddType application/x-httpd-source .phps
    将DirectoryIndex index.html   改为    DirectoryIndex index.php index.html

保存退出。执行httpd -t

[[email protected] php-5.6.4]# httpd -t    //检查配置文件是否有误
[[email protected] php-5.6.4]# /etc/rc.d/init.d/httpd24 reload    //重读配置文件
[[email protected] php-5.6.4]# httpd -M |grep php    //检查php的模块是否已加载

AH00558: httpd: Could not reliably determine the server‘s fully qualified domain name, using localhost.localdomain. Set the ‘ServerName‘ directive globally to suppress this message

php5_module (shared)

编辑一个测试页,测试LAMP是否已结合成功----

[[email protected] php-5.6.4]# vim /usr/local/apache/htdocs/index.php
<?php
        $conn=mysql_connect(‘127.0.0.1‘,‘root‘,‘root‘);  //此处mysql链接账号密码为安装完成Mariadb后,运行安全初始化时设置的。
        if ($conn)
                echo "OK";
        else
                echo "Faulse";
        phpinfo();
?>

11、在浏览器中打开网页进行查看:出现如下页面,即表示搭建成功。

12、搭建基于主机名的虚拟主机安装phpMyadmin,实现mysql(MariaDB)图形化管理:

[[email protected] php-5.6.4]# vim /etc/httpd24/httpd.conf    //编辑httpd配置文件
1)注释中心主机:#DocumentRoot "/usr/local/apache/htdocs"
2)添加:    Include /etc/httpd24/vhosts.conf

13、创建并编辑虚拟主机配置文件:

[[email protected] php-5.6.4]# vim /etc/httpd24/vhosts.conf

<VirtualHost 172.16.113.14:80>

DocumentRoot /web/vhosts/pma

ServerName pma.su.com

CustomLog "/var/log/httpd/pma_access.log" common

ErrorLog "/var/log/httpd/pma_error.log"

</VirtualHost>

<Directory "/web/vhosts/pma">    //httpd2.4版本必须为网站目录授权才可访问

AllowOverride None

Options None

Require all granted

</Directory>

[[email protected] php-5.6.4]# mkdir -pv /var/log/httpd     //创建日志文件目录

[[email protected] php-5.6.4]# mkdir -pv /web/vhosts/pma    //创建网站根目录

mkdir: created directory `/web‘

mkdir: created directory `/web/vhosts‘

mkdir: created directory `/web/vhosts/pma‘

[[email protected] php-5.6.4]# httpd -t    //检查配置文件是否有误

[[email protected] pma]# /etc/rc.d/init.d/httpd24 restart    //重启httpd服务

[[email protected] php-5.6.4]# mv /usr/local/src/phpMyAdmin-4.0.5-all-languages/* /web/vhosts/pma/

//将程序文件移动到网站根目录下

//配置phpMyadmin配置文件

[[email protected] pma]# cp config.sample.inc.php config.inc.php

//将配置文件模板复制为配置文件(去掉sample)

[[email protected] pma]# vim config.inc.php       //编辑配置文件

$cfg[‘blowfish_secret‘] = ‘aadf$#23SDA$%8b7c6d‘;        //在此项添加一个随机数

编辑测试主机hosts文件(C:\Windows\System32\drivers\etc),添加如下信息,并保存

172.16.113.14 pma.su.com

在浏览器输入pma.su.com访问即可。

待续----------------------------------------

时间: 2024-10-27 08:03:51

CentOS6 编译安装LAMP(Apache,Mariadb,php)_2015092001的相关文章

Centos 6.9 编译安装 LAMP + xcache

Centos 6.9 编译安装 LAMP apache 2.4 + Mysql 5.7 + php5.6.34 + Fast-cgi + xcache 实验环境:VMware Workstation Pro 14(试用版) 系统平台: CentOS release 6.9 (Final) 内核 2.6.32-696.el6.x86_64 Apache/2.4.29 (Unix) PHP 5.6.34 (cli) xcache 3.2.0 1. 编译安装apache 2.4 参考Centos 6.

LAMP编译安装之Apache+php+mysql

环境模型: (1)PHP作为apache的模块编译安装. (2)mysql数据库在另一台服务器上安装.版本为MariaDB5.5.33    IP:192.168.1.124 (3)PHP版本5.4.36,http的版本2.4 (4)安装Apache和php的主机IP为192.168.1.123. 一.编译安装apache    1.解决依赖关系     httpd-2.4.9需要较新版本的apr和apr-util,因此需要事先对其进行升级.升级方式有两种,一种是通过源代码编译安装,一种是直接升

CentOS6.3 编译安装LAMP(2):编译安装 Apache2.2.25

所需源码包: /usr/local/src/Apache-2.2.25/httpd-2.2.25.tar.gz 编译安装 Apache2.2.25 #切换到源码目录 cd /usr/local/src/Apache-2.2.25 tar -xzvf ./httpd-2.2.25.tar.gz cd ./httpd-2.2.25 #生成configure ./configure --prefix=/usr/local/apache --with-included-apr --enable-so -

CentOS6.3 编译安装LAMP(4):编译安装 PHP5.2.17

所需源码包: /usr/local/src/PHP-5.2.17/libmcrypt-2.5.8.tar.gz /usr/local/src/PHP-5.2.17/mhash-0.9.9.9.tar.gz /usr/local/src/PHP-5.2.17/mcrypt-2.6.8.tar.gz /usr/local/src/PHP-5.2.17/libiconv-1.14.tar.gz /usr/local/src/PHP-5.2.17/php-5.2.17.tar.gz 在编译PHP之前,先

Centos 7.0 编译安装LAMP(Linxu+apache+mysql+php)之源码安装Mysql (二)

mysql 简介: MySQL是一个关系型数据库管理系统,关系数据库将数据保存在不同的表中,这样就增加了速度并提高了灵活性.目前其属于 Oracle 旗下产品.MySQL 是最流行的关系型数据库管理系统之一,在 WEB 应用方面,MySQL是最好的 RDBMS (Relational Database Management System,关系数据库管理系统) 应用软件.MySQL所使用的 SQL 语言是用于访问数据库的最常用标准化语言. 安装环境: 系统: centos 7.0 最小化安装 软件

Centos 7.0 编译安装LAMP(Linxu+apache+mysql+php)之源码安装Apache (一)

Apache 简介: Apache是世界使用排名第一的Web服务器软件.它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的Web服务器端软件之一.它快速.可靠并且可通过简单的API扩充,将Perl/Python等解释器编译到服务器中. 安装环境: 系统: centos 7.0 最小化安装 软件:httpd-2.4.26 依赖包:apr .apr-util .pcre .gcc .gcc-c++ .perl-dvel.perl.openssl .openssl-

编译安装LAMP之安装Apache+php与管理(十五)

[教程主题]:编译安装LAMP之安装Apache+php与管理 [课程录制]: 创E [主要内容] [1]编译安装Apache+PHP 1.安装程序依赖库和开发环境 为了省事把所需要的库文件全都安装上,可以使用rpm包安装,也可以用yum命令安装, yum -y install gcc gcc-c++ autoconf automake make libjpeg libjpeg-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-dev

[转]在ubuntu linux下以编译方式安装LAMP(apache mysql php)环境

FROM : http://www.cnblogs.com/eleganthqy/archive/2010/02/28/1675217.html 最近转向到了使用ubuntu做桌面,安装好系统以来一直都没配置lamp开发环境.由于很久以来没有自己编译安装过apache php mysql了有些手生,决定再实践一下.最近一次安装web环境是在centos下装nginx php + fastcgi.虽然以前在centos freebsd下都装过amp环境,但大多是依照网络上的阿哥的步骤一步步来,早在

Centos 7.0 编译安装LAMP(Linxu+apache+mysql+php)之源码安装php (三)

PHP简介: PHP(外文名:PHP: Hypertext Preprocessor,中文名:"超文本预处理器")是一种通用开源脚本语言.语法吸收了C语言.Java和Perl的特点,利于学习,使用广泛,主要适用于Web开发领域.PHP 独特的语法混合了C.Java.Perl以及PHP自创的语法.它可以比CGI或者Perl更快速地执行动态网页.用PHP做出的动态页面与其他的编程语言相比,PHP是将程序嵌入到HTML(标准通用标记语言下的一个应用)文档中去执行,执行效率比完全生成HTML标