2.4 安装 apache 和 php
首先切换目录到 $(SRCDIR)。为了节省篇幅,下面直接以命令表示。
cd apache_1.3.X
./configure --prefix=/home/www --enable-module=so
make
make install
cd ../php-4.3.X
./configure --prefix=/home/www/php \
--with-apxs=/home/www/bin/apxs --disable-debug \
--enable-pic --disable-rpath --enable-inline-optimization \
--with-dom --with-gd --with-freetype-dir=/usr/lib \
--with-png-dir --with-iconv --with-jpeg-dir --with-zlib \
--enable-track-vars
make
make install
[补充] 如果使用 apache2,以上步骤中需要修改的地方是:
apache 的 configure 命令改成:
./configure --prefix=/home/www --enable-so
php 的 configure 命令里面的 --with-apxs=/home/www/bin/apxs 改成:
--with-apxs2=/home/www/bin/apxs
[补充] php5 不默认编译 mysql 支持,所以如果需要 mysql 支持的话,应该
在 php 的 configure 命令中加入 --with-mysql
我是redhat9.
装php-4.3.1时make出现error:
dl -lnsl -lcrypt -lxml2 -lz -lm -o sapi/cli/php(好像到这儿就停止了)
ext/mysql/libmysql/my_tempnam.lo(.text+0x4c): In function `my_tempnam':
/home/smthbbs/php-4.3.1/ext/mysql/libmysql/my_tempnam.c:103: the use of `tempnam' is dangerous, better use `mkstemp'
ext/mysql/libmysql/my_lib.lo(.text+0x3d1): In function `my_dir':
/home/smthbbs/php-4.3.1/ext/mysql/libmysql/my_lib.c:169: undefined reference to
`errno'
ext/mysql/libmysql/my_lib.lo(.text+0x5ef): In function `my_stat':
/home/smthbbs/php-4.3.1/ext/mysql/libmysql/my_lib.c:588: undefined reference to
`errno'
ext/mysql/libmysql/my_malloc.lo(.text+0xde): In function `my_malloc':
/home/smthbbs/php-4.3.1/ext/mysql/libmysql/my_malloc.c:24: undefined reference to `errno'
ext/mysql/libmysql/my_realloc.lo(.text+0xd5): In function `my_realloc':
/home/smthbbs/php-4.3.1/ext/mysql/libmysql/my_realloc.c:44: undefined reference
to `errno'
ext/mysql/libmysql/my_delete.lo(.text+0x86): In function `my_delete':
/home/smthbbs/php-4.3.1/ext/mysql/libmysql/my_delete.c:16: undefined reference to `errno'
ext/mysql/libmysql/my_tempnam.lo(.text+0x89):/home/smthbbs/php-4.3.1/ext/mysql/libmysql/my_tempnam.c:108: more undefined references to `errno' follow
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
【 在 fye (扉) 的大作中提到: 】
: 我按照文档中的说明改了一下.
: 可以正常安装了.
--
FROM 61.179.12.*