apache+php安装全攻略

来源:互联网 发布:js radio 选中事件 编辑:程序博客网 时间:2024/06/05 10:41

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的配置。

 

原创粉丝点击