Centos6.7 编译安装 Apache PHP
Centos6.7 编译安装 Apache PHP
原文地址:http://www.cnblogs.com/caoguo/p/4968039.html ##### Apache 编译安装 ####
[root@localhost ~]# yum install gcc gcc-c++ make wget
[root@localhost ~]# yum install zlib-devel openssl-devel
[root@localhost ~]# yum install -y perl perl-devel ) apr
[root@localhost src]# wget http://mirror.bit.edu.cn/apache//apr/apr-1.5.2.tar.gz
[root@localhost src]# tar zxvf apr-1.5..tar.gz
[root@localhost src]# cd apr-1.5.
[root@localhost apr-1.5.]# ./configure --prefix=/usr/local/apache/apr
[root@localhost apr-1.5.]# make && make install ) apr-util
[root@localhost src]# wget http://mirror.bit.edu.cn/apache//apr/apr-util-1.5.4.tar.gz
[root@localhost src]# tar zxvf apr-util-1.5..tar.gz
[root@localhost src]# cd apr-util-1.5.
[root@localhost apr-util-1.5.]# ./configure --prefix=/usr/local/apache/apr-util --with-apr=/usr/local/apache/apr
[root@localhost apr-util-1.5.]# make && make install ) pcre
[root@localhost src]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz
[root@localhost src]# tar zxvf pcre-8.37.tar.gz
[root@localhost src]# cd pcre-8.37
[root@localhost pcre-8.37]# ./configure
[root@localhost pcre-8.37]# make && make install ) apache
[root@localhost ~]# cd /usr/local/src/
[root@localhost ~]# wget http://mirrors.cnnic.cn/apache//httpd/httpd-2.4.17.tar.gz
[root@localhost src]# tar zxvf httpd-2.4..tar.gz
[root@localhost src]# cd httpd-2.4.
[root@localhost httpd-2.4.]# ./configure --prefix=/usr/local/apache \
--with-apr=/usr/local/apache/apr/bin/apr--config \
--with-apr-util=/usr/local/apache/apr-util/bin/apu--config \
--enable-module=so \
--enable-mods-shared=all \
--enable-deflate \
--enable-expires \
--enable-headers \
--enable-cache \
--enable-file-cache \
--enable-mem-cache \
--enable-disk-cache \
--enable-mime-magic \
--enable-authn-dbm \
--enable-vhost-alias \
--enable-so \
--enable-rewrite \
--enable-ssl \
--with-mpm=prefork [root@localhost httpd-2.4.]# make && make install #index.php
#AddHandler php5-script .php
#AddType text/html .php
###### httpd end ########### [root@localhost ~]# ln -s /usr/local/apache/conf /etc/httpd
[root@localhost ~]# ln -s /usr/local/apache/bin/* /usr/sbin/ [root@localhost ~]# touch /etc/init.d/httpd
[root@localhost ~]# chmod 755 /etc/init.d/httpd [root@localhost ~]# vi /etc/init.d/httpd
#!/bin/bash
#
# httpd Startup script for the Apache HTTP Server
#
# chkconfig: - 85 15
# description: The Apache HTTP Server is an efficient and extensible \
# server implementing the current HTTP standards.
# processname: httpd
# config: /etc/httpd/conf/httpd.conf
# config: /etc/sysconfig/httpd
# pidfile: /var/run/httpd/httpd.pid
#
### BEGIN INIT INFO
# Provides: httpd
# Required-Start: $local_fs $remote_fs $network $named
# Required-Stop: $local_fs $remote_fs $network
# Should-Start: distcache
# Short-Description: start and stop Apache HTTP Server
# Description: The Apache HTTP Server is an extensible server
# implementing the current HTTP standards.
### END INIT INFO # Source function library.
. /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/sbin/apachectl
httpd=${HTTPD-/usr/sbin/httpd}
prog=httpd
pidfile=${PIDFILE-/usr/local/apache/logs/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
}
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 $@
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful|help|configtest}"
RETVAL=2
esac
exit $RETVAL [root@localhost ~]# chkconfig --add httpd
[root@localhost ~]# chkconfig httpd on
##### PHP 编译安装 ####
[root@localhost ~]# yum install libxml2-devel curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel net-snmp net-snmp-devel [root@localhost src]# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
[root@localhost src]# tar zxvf libiconv-1.14.tar.gz
[root@localhost src]# cd libiconv-1.14
[root@localhost libiconv-1.14]# ./configure --prefix=/usr/local/php/libiconv
[root@localhost libiconv-1.14]# make && make install [root@localhost src]# wget http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
[root@localhost src]# tar zxvf libmcrypt-2.5..tar.gz
[root@localhost src]# cd libmcrypt-2.5.
[root@localhost libmcrypt-2.5.]# ./configure
[root@localhost libmcrypt-2.5.]# make && make install [root@localhost libltdl]# /sbin/ldconfig && cd libltdl/
[root@localhost libltdl]# ./configure --enable-ltdl-install
[root@localhost libltdl]# make && make install [root@localhost src]# wget http://nchc.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz
[root@localhost src]# tar zxvf mhash-0.9.9.9.tar.gz
[root@localhost src]# cd mhash-0.9.9.9
[root@localhost mhash-0.9.9.9]# ./configure
[root@localhost mhash-0.9.9.9]# make && make install [root@localhost src]# wget http://nchc.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz
[root@localhost src]# tar zxvf mcrypt-2.6..tar.gz
[root@localhost src]# cd mcrypt-2.6.
[root@localhost mcrypt-2.6.]# /sbin/ldconfig && export LD_LIBRARY_PATH=/usr/local/lib: LD_LIBRARY_PATH
[root@localhost mcrypt-2.6.]# ./configure
[root@localhost mcrypt-2.6.]# make && make install [root@localhost src]# wget http://cn2.php.net/distributions/php-5.6.15.tar.gz
[root@localhost src]# tar zxvf php-5.6..tar.gz
[root@localhost src]# cd php-5.6. [root@localhost php-5.6.]# ./configure --prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--with-iconv=/usr/local/php/libiconv \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-pear \
--with-freetype-dir \
--with-zlib \
--with-libxml-dir \
--with-iconv-dir \
--with-xmlrpc \
--with-mhash \
--with-mcrypt \
--with-curl \
--with-openssl \
--with-snmp \
--with-gettext \
--enable-pdo \
--enable-mbstring \
--enable-ctype \
--enable-simplexml \
--enable-ftp \
--enable-sockets \
--enable-gd-native-ttf \
--enable-sysvsem \
--enable-exif \
--enable-sysvshm \
--enable-xml \
--enable-dom \
--enable-simplexml \
--enable-shmop \
--enable-zip \
--enable-mbregex \
--enable-bcmath \
--enable-inline-optimization \
--enable-soap [root@localhost php-5.6.]# make && make install [root@localhost php-5.6.]# cp php.ini-production /usr/local/php/etc/php.ini
[root@localhost ~]# ln -s /usr/local/php/bin/* /usr/sbin/
Centos6.7 编译安装 Apache PHP的更多相关文章
- 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 ...
- CentOS6.3 编译安装LAMP(2):编译安装 Apache2.4.6
Apache官方说: 与Apache 2.2.x相比,Apache 2.4.x提供了很多性能方面的提升,包括支持更大流量.更好地支持云计算.利用更少的内存处理更多的并发等.除此之外,还包括性能提升.内 ...
- 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. ...
- CentOS6.3 编译安装LAMP(4):编译安装 PHP5.3.27
所需源码包: /usr/local/src/PHP-5.3.27/libmcrypt-2.5.8.tar.gz /usr/local/src/PHP-5.3.27/mhash-0.9.9.9.tar. ...
- centos6.5编译安装lamp开发环境
一.系统以及软件的准备 系统及编译安装包的下载地址:http://pan.baidu.com/s/1jIjqinc 密码:ghc2 说明:由于centos6.5是分卷压缩的,且压缩为三个压缩包,所 ...
- CentOS编译安装Apache 2.4.x时报错:configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.
先前按照这篇文章“CentOS6.x编译安装LAMP(2):编译安装 Apache2.2.22”去编译安装Apache2.2.x版本时,安装得挺顺利,今天换成Apache2.4.x版本,安装方法一样, ...
- 在CentOS6上编译安装实现LAMP(php-modules)+phpMyAdmin安装过程全记录
php与apache协作有三种模式:CGI.modules.FastCGI. 在CGI模式下,用户请求php文件时,apache会启动响应进程,调用php处理器处理请求,然后将结果返回给客户端.用户响 ...
- CentOS6.8编译安装LAMP
CentOS6.8编译安装Apache2.4.25.MySQL5.7.16.PHP5.6.29 初始化 #固定IP vi /etc/sysconfig/network-scripts/ifcfg-et ...
- centos手动编译安装apache、php、mysql
64位centos 5.5手动安装lamp,要求curl.json.pdo_mysql.gd,记录如下. centos 5.4.5.5.5.6的内核都是2.6.18,都可以安装php 5.3. 卸载旧 ...
随机推荐
- Ubuntu 16.04开机自动开启数字键盘NumLock
注意:以下方法不适合在登录时开启,只能是登录后开启.而且我经过测试之后会自动暗下去,但是不影响功能使用.这个是BUG的修复方法:https://askubuntu.com/questions/5090 ...
- Android: 阻止ScrollView随着数据加载自动滚动
当ScrollView中有类似GridView的控件时,当数据加载后ScrollView会自动滚动.要阻止这种事情发生,我们需要做的是在ScrollView的下层容器中添加android:descen ...
- Lein: Exception in thread "Thread-3" java.net.ConnectException: Connection refused
leiningen Leiningen是你的主要工具, 它用于: 启动一个 REPL 下载+安装类库 运行你的程序 启动一个服务器, 运行你所写的webapps 安装 brew install lei ...
- Android: ADB not responding. You can wait more, or kill “adb.exe”
Windows Only: Open a command prompt with administration permission and type netsh interface tcp set ...
- keil编译后生成的M51文件解析
通过*.m51文件我们能够清楚的看到单片机存储器的使用情况,以及能够看到每一个变量包含局部变量的位置. 之前碰到一个问题,相同的程序,在small模式下编译后执行没问题,但在large模式下能够编译. ...
- 使用SwipeRefreshLayout和RecyclerView实现仿“简书”下拉刷新和上拉载入很多其它
一.概述 本篇博客介绍的是怎样使用SwipeRefreshLayout和RecyclerView实现高仿简书Android端的下拉刷新和上拉载入很多其它的效果. 依据效果图能够发现,本案例实现了例如以 ...
- 从Linux 2.6.8内核的一个TSO/NAT bug引出的网络问题排查观点(附一个skb的优化点)
梦中没有错与对,梦中没有恨和悔...最好闭上你的嘴.这样才算可爱...我不会说:这不公道,我不能接受.我会用朴素的文字记录点点滴滴,早上4点多起来,一气呵成最近的收获与评价,愤慨与忏悔. 四年多前的一 ...
- Cocos2d坐标系具体解释
1.笛卡尔坐标系 左手坐标系(Direct3D坐标系),右手坐标系(Direct3D坐标系) 大拇指和食指分别相应x轴和y轴 2.UI坐标系 iOS/Android/Windows SDK中的通用UI ...
- Chrome浏览器扩展开发系列之十四:本地消息机制Native messagin
Chrome浏览器扩展开发系列之十四:本地消息机制Native messaging 2016-11-24 09:36 114人阅读 评论(0) 收藏 举报 分类: PPAPI(27) 通过将浏览器 ...
- NSDate 工具
#import "NSDate+XMGExtension.h" @implementation NSDate (XMGExtension) /** * 是否为今天 */ - (BO ...