免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1202 | 回复: 0
打印 上一主题 下一主题

php5 linux下的安装 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-02-06 12:08 |只看该作者 |倒序浏览
[下载地址]
php 5.0
http://cn2.php.net/get/php-5.0.2.tar.gz/from/a/mirror
http://cn.php.net/distributions/php-5.0.2.tar.gz
Apache 2.0
http://apache.justdn.org/httpd/httpd-2.0.53.tar.gz
Zend
http://ftp.superuser.co.kr/pub/ZendOptimizer/
http://ftp.superuser.co.kr/pub/Z ... glibc21-i386.tar.gz
   zend的最新版安装是好像有点问题,就下载这个版本就可以
libxml2-2.X.X.tar.gz   
        http://xmlsoft.org/sources/?C=N;O=A
        http://xmlsoft.org/sources/libxml2-2.6.19.tar.gz
zlib-1.X.X.tar.gz
        http://www.zlib.net/zlib-1.2.2.tar.gz
jpegsrc.v6b.tar.gz
        ftp://ftp.uu.net/graphics/jpeg/
libpng
        http://www.libpng.org/pub/png/libpng.html
        http://prdownloads.sourceforge.n ... fig.tar.gz?download
freetype2-X.X.tar.gz
        http://www.fretype.org
        http://prdownloads.sourceforge.n ... gz?use_mirror=jaist
        http://jaist.dl.sourceforge.net/ ... eetype-2.1.9.tar.gz
xpm-3.4k-2.i386.rpm
http://linux.maruhn.com/sec/xpm.html
安装 apache 2.0
wget http://apache.justdn.org/httpd/httpd-2.0.53.tar.gz
tar zxvf httpd-2.0.53.tar.gz
cd httpd-2.0.53
./configure --prefix=/soft/apache2 --enable-module=so
make
make install
编辑apache配置文件httpd.conf
#vi /soft/apache2/conf/httpd.conf
一般都在
#AddType application/x-tar .tgz
下加一行
#LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
如果你搜索其它地方没有以下这行
LoadModule php5_module modules/libphp5.so
请把上面的#号去掉
还有找到
DirectoryIndex index.html index.html.var  
在后面加 index.php 让它把index.php做为默认页
找到
# don't use Group #-1 on these systems!
把下面的用户名和组改为
User apache
Group apache
(原来好像是nobody)
再找
#ServerName  
把#去掉,后面的IP改成你的IP.
找到
DocumentRoot "/soft/apache2/htdocs"
把/soft/apache2/htdocs改为你存放网页文件的路径
为了让中文网页没乱码
找到
AddDefaultCharset iso8859-1
把后面的iso8859-1改为gb2312 或者是干脆off
其他的选项就自己修改吧!或者到http://article.21e.cn  有一个专门的httpd.conf的说明!
保存httpd.conf文件.
启动apache
# /soft/apache2/bin/apachectl start  
如果没有出错,写一个测试页放到你网页目录下.访问就应该可以看到php的版本等信息了!
安装XPM
wget ftp://ftp.pbone.net/vol6/ftp.red ... xpm-3.4k-2.i386.rpm
rpm -ivh xpm-3.4k-2.i386.rpm
安装libxml
wget http://xmlsoft.org/sources/libxml2-2.6.19.tar.gz
tar zxfv libxml2-2.6.19.tar.gz
cd libxml2-2.6.19
./configure
(xml默认安装就可以,不要指定路径了,因为安装时php可能找不到它,PHP5只支持libxml2-2.5.10以上版本)
make
make install
安装zlib
wget http://www.zlib.net/zlib-1.2.2.tar.gz
tar zxfv zlib-1.2.2.tar.gz  
cd zlib-1.2.2  
./configure --prefix=/soft/zlib2
(注意,如果您以前没有安装zlib,可以不指定路径,我是没有删除以前的低版本才指定的!以下雷同!)
make  
make install  
安装jpeg
wget ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz                     
tar zxfv jpegsrc.v6b.tar.gz
mkdir /soft/jpeg6  
mkdir /soft/jpeg6/include  
mkdir /soft/jpeg6/lib
mkdir /soft/jpeg6/bin
mkdir /soft/jpeg6/man/
mkdir /soft/jpeg6/man/man1/
./configure --prefix=/soft/jpeg6
安装libpng:
wget http://jaist.dl.sourceforge.net/ ... 1.2.8-config.tar.gz
tar zxfv libpng-1.2.8-config.tar.gz  
cd libpng-1.2.8-config  
./configure --prefix=/soft/libpng2  
make  
make install
安装freetype:
wget http://jaist.dl.sourceforge.net/ ... eetype-2.1.9.tar.gz
tar zxfv freetype-2.1.9.tar.gz  
cd freetype-2.1.9  
./configure --prefix=/soft/freetype2  
make  
make install
安装gd库:
wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz
tar zxfv gd-2.0.33.tar.gz
cd gd-2.0.33   
./configure --prefix=/soft/gd2 --with-zlib=/soft/zlib2/
--with-png=/soft/libpng2/ --with-jpeg=/soft/jpeg6/
--with-freetype=/soft/freetype2/ (请指定及格插件的安装路径,否则安装php的时候可能出错!)
make  
make install  
安装Zend
wget http://ftp.superuser.co.kr/pub/Z ... glibc21-i386.tar.gz
解压后执行进入目录执行
./install.sh
一步一步下来,当出现:
Enter the location of your php.ini file
的提示时,输入:/soft/php/etc
安装php5:
wget http://cn.php.net/distributions/php-5.0.2.tar.gz
tar zxvf php-5.0.2.tar.gz  
cd php-5.0.2  
./configure --prefix=/soft/php5
--with-apxs2=/soft/apache2/bin/apxs  --with-jpeg-dir=/soft/jpeg6/
--with-png-dir=/soft/libpng2/ --with-gd=/soft/gd2/
--with-freetype-dir=/soft/freetype2/ --enable-trace-vars
--with-zlib-dir=/soft/zlib2/ -with-mysql=/soft/mysql
make  
make install  
cp php.ini-dist /soft/php5/lib/php.ini
        
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/90973/showart_1815394.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP