安装php-5.2.5

| 评论(4) | 暂无引用通告

-->   本文是一篇Red Hat Enterprise Linux AS release 3 环境下php安装笔记,目的在于为以后再次安装php作一个参考。
  首先假设系统中已经安装好可以动态加载模块的apache服务器和mysql服务器,若尚未完成这两个服务的搭建,请先搭建这两个服务。

  接下我们将安装php及将其于apache与mysql集成在一起。
  准备软件包:
下载php源码包,首选国内的镜像:http://cn2.php.net/get/php-5.2.5.tar.bz2/from/this/mirror
解压软件包:
[root@centerws root]# tar jxvf php-5.2.5.tar.bz2
进入软件包目录阅读README和INSTALL文件:
[root@centerws root]# cd php-5.2.5
[root@centerws php-5.2.5]# less INSTALL

然后按照INSTALL文件中的方法进行安装:

运行configure脚本,黙认的安装目录为/usr/local,指定apxs的路径,并支持mysql:

 ./configure --with-apxs2=/home/httpd/bin/apxs --with-mysql

  提示需安装2.6.11或以上版本的libxml2

configure: error: libxml2 version 2.6.11 or greater required.

libxml2的下载地址为:ftp://xmlsoft.org/libxml2/
下载版本2.6.30,速度稍稍有点慢
ftp://xmlsoft.org/libxml2/libxml2-2.6.30.tar.gz

解压后直接使用默认选项进行配置,没什么特别的操作:./configure;make;make install

然后继续安装php

./configure --with-apxs2=/home/httpd/bin/apxs --with-mysql
make
运行完了以后会提示运行make test
Build complete.
Don't forget to run 'make test'.

在测试时出了点错:
PASS CLI long options [sapi/cli/tests/015.phpt]
=====================================================================
TIME END 2007-12-25 11:18:08

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :   56
Exts tested     :   23
---------------------------------------------------------------------

Number of tests : 4566              3011
Tests skipped   : 1555 ( 34.1%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    2 (  0.0%) (  0.1%)
Tests passed    : 3009 ( 65.9%) ( 99.9%)
---------------------------------------------------------------------
Time taken      :  240 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #16069 (ICONV transliteration failure) [ext/iconv/tests/bug16069.phpt]
iconv stream filter [ext/iconv/tests/iconv_stream_filter.phpt]
=====================================================================

You may have found a problem in PHP.
We would like to send this report automatically to the
PHP QA team, to give us a better understanding of how
the test cases are doing. If you don't want to send it
immediately, you can choose "s" to save the report to
a file that you can send us later.
Do you want to send this report now? [Yns]: n

估计这两个错不会影响php的使用我就直安装了:

make install

拷贝配置文件:

[root@centerws php-5.2.5]# cp php.ini-dist  /usr/local/etc/php.ini

编缉httpd.conf文件(如果make install已将其添进去的话就不用改了):

LoadModule php5_module modules/libphp5.so

AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

启动httpd:

[root@centerws httpd]# ./bin/apachectl start

查看启动信息:

[root@centerws httpd]# cat logs/error_log
[Tue Dec 25 11:51:50 2007] [notice] Apache/2.0.59 (Unix) PHP/5.2.5 configured -- resuming normal operations


暂无引用通告

发送引用通告网址: http://supersun.info/mt/mt-tb.cgi/820
如果您想引用这篇日记到您的Blog,请复制上面的链接,放置到您发表文章时的相应界面中。

评论(4)

再过几个小时2008的钟声就敲响了,
竞博客祝你在新的一年里身体健康,合家欢乐,万事如意!

新年快乐呀!
呵呵
2008到了 哦

新年快乐!呵呵!

新年快乐!呵呵!

发表评论

最新资源

  • IMG_1437.JPG
  • line.png
  • bar.png
  • perl_calander.jpg

关于此日记

此日记由 supersun 发表于 2007年12月30日 16:25

此Blog上的上一篇日记去掉Linux的系统报警声

此Blog上的下一篇日记迪拜帆船酒店(BurjAl-ArabHotel)

首页归档页可以看到最新的日记和所有日记。