apache+php安装全攻略

apache2+php5安装全攻略

1、Apache2 的安装:  

版本:httpd-2.0.59.tar.gz

# gzip -d httpd-2.0.59.tar.gz

# tar -xvf httpd-2.0.59.tar

# cd httpd-2.0.59

# ./configure --prefix=/usr/local/apache2 --enable-shared=max --enable-module=most

# make

# make install

=======================================================================

2、libxml2

安装版本:libxml2-2.6.29.tar.gz

# gzip -d libxml2-2.6.29.tar.gz

# tar -xvf libxml2-2.6.29.tar

# cd libxml2-2.6.29

# ./configure

# make

# make install

 =======================================================================

3、zlib

安装版本:zlib-1.2.3.tar.gz

# gzip -d zlib-1.2.3.tar.gz

# tar -xvf zlib-1.2.3.tar

# cd zlib-1.2.3

# ./configure

# make

# make install

=======================================================================

4、libpng

安装版本:libpng-1.2.18.tar.gz

# gzip -d libpng-1.2.18.tar.gz

# tar -xvf libpng-1.2.18.tar

# cd libpng-1.2.18

# cd scripts/

# mv makefile.linux ../makefile

# cd ..

# make

# make install

注意,这里的makefile不是用./configure生成,而是直接从scripts/里拷一个

 =======================================================================

5、jpeg

安装版本:jpegsrc.v6b.tar.gz

# gzip -d jpegsrc.v6b.tar.gz

# tar -xvf jpegsrc.v6b.tar

# cd jpeg-6b

# ./configure --enable-shared

# make

# make install

注意,这里configure一定要带--enable-shared参数,不然,不会生成共享库

 =======================================================================

6、安装freetype

版本:freetype-2.1.9.tar.gz

# gzip -d freetype-2.1.9.tar.gz

# tar -xvf freetype-2.1.9.tar

# cd freetype-2.1.9

# ./configure

# make

# make install

=======================================================================

7、GD

安装版本:gd-2.0.33.tar.gz

# gzip -d gd-2.0.33.tar.gz

# tar -xvf gd-2.0.33.tar

 # cd gd-2.0.33

# ./configure --with-png --with-freetype=/usr/local/lib --with-jpeg

# make

# make install

注意 freetype参数一定要加上路径

=======================================================================

其他安装所需要的库

8、libiconv

安装版本:libiconv-1.9.2.tar.gz

# tar -zxvf libiconv-1.9.2.tar.gz

# cd libiconv-1.9.2

# ./configure --prefix=/usr/local/libiconv

# make

# make install

=======================================================================

9、libmcrypt-2.5.8  php支持mcrypt des加密

# ./configure

# make

# make install

=======================================================================

10、openssl-0.9.8e.tar.gz

# ./configure

 # make

# make install

=======================================================================

11、php安装版本:

php-5.2.0.tar.gz

#./configure --with-apxs2=/usr/local/apache2/bin/apxs /

--with-oracle=$ORACLE_HOME --with-oci8=$ORACLE_HOME /

--enable-sockets /

--enable-ftp /

--with-ldap /

--with-xml /

--with-gd /

--with-zlib /

--with-png=/usr/lib /

--with-jpeg /

--with-freetype=/usr/local/lib /

--with-mcrypt /

--with-openssl=/usr/local/ssl /

/*注释:没有加mysql编译

# make

# make install

# cp ./php.ini-dist /usr/local/lib/php.ini

把php加到apache里去 # vi /usr/local/apache2/conf/httpd.conf LoadModule php5_module modules/libphp5.so  //httpd.conf里已经添加好了的添加  AddType application/x-httpd-php .php

======================================================================

12、配置apache httpd.conf文件

Group nobody //不修改此处,apache不启动也不报错

DocumentRoot

ServerName

=======================================================================

13、apache重启

1)在/usr/local/apache2/bin/目录下  # ./apachectl start  启动apache        

2)在DocumentRoot 下建一php文件, echo phpinfo();     

3)浏览器查看该php文件,检查apache+php的配置。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值