分享
 
 
 

Centos6.7编译安装ApachePHP

王朝学院·作者佚名  2016-08-27
窄屏简体版  字體: |||超大  

Centos6.7 编译安装 Apachephp

##### 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-devel1) 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.2.tar.gz

[root@localhost src]# cd apr-1.5.2[root@localhost apr-1.5.2]# ./configure --prefix=/usr/local/apache/apr

[root@localhost apr-1.5.2]# make &&make install2) 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.4.tar.gz

[root@localhost src]# cd apr-util-1.5.4[root@localhost apr-util-1.5.4]# ./configure --prefix=/usr/local/apache/apr-util --with-apr=/usr/local/apache/apr

[root@localhost apr-util-1.5.4]# make &&make install3) 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 install4) 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.17.tar.gz

[root@localhost src]# cd httpd-2.4.17[root@localhost httpd-2.4.17]# ./configure --prefix=/usr/local/apache \--with-apr=/usr/local/apache/apr/bin/apr-1-config \--with-apr-util=/usr/local/apache/apr-util/bin/apu-1-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.17]# 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.8.tar.gz

[root@localhost src]# cd libmcrypt-2.5.8[root@localhost libmcrypt-2.5.8]# ./configure

[root@localhost libmcrypt-2.5.8]# 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.8.tar.gz

[root@localhost src]# cd mcrypt-2.6.8[root@localhost mcrypt-2.6.8]# /sbin/ldconfig && export LD_LIBRARY_PATH=/usr/local/lib: LD_LIBRARY_PATH

[root@localhost mcrypt-2.6.8]# ./configure

[root@localhost mcrypt-2.6.8]# 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.15.tar.gz

[root@localhost src]# cd php-5.6.15[root@localhost php-5.6.15]# ./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.15]# make &&make install

[root@localhost php-5.6.15]# cp php.ini-production /usr/local/php/etc/php.ini

[root@localhost~]# ln -s /usr/local/php/bin/*/usr/sbin/

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有