Linux下 apache 集成 php 出现的问题
cnidb 2005-07-13 08:37:36 操作系统
Fedora Core 4
安装步骤:
Apache:
# tar xvzf httpd-2.0.54.tar.gz
# cd httpd-2.0.54
# ./configure --prefix=/usr/local/httpd2 --enable-module=so
# make
# make install
察看编译进apache的模块:
# /usr/local/httpd2/bin/httpd -l
Compiled in modules:
core.c
mod_access.c
mod_auth.c
mod_include.c
mod_log_config.c
mod_env.c
mod_setenvif.c
prefork.c
http_core.c
mod_mime.c
mod_status.c
mod_autoindex.c
mod_asis.c
mod_cgi.c
mod_negotiation.c
mod_dir.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_so.c
------------------------------------------------------------------------------------
安装PHP
# cd /usr/local
# tar -zxvf php-5.0.4.tar.gz
# mv php-5.0.4 php5
# cd php5/
# ./configure --with-apxs2=/usr/local/httpd2/bin/apxs --enable-track-vars --enable-ftp
# make
# make install
# cp php.ini-dist /usr/local/lib/php.ini
在httpd.conf头部添加:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php3
重新启动Apache
# /etc/rc.d/init.d/httpd restart
的时候出错:
Syntax error on line 1038 of /usr/local/httpd2/conf/httpd.conf:
Cannot load /usr/local/httpd2/modules/libphp5.so into server: /usr/local/httpd2/ modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
/usr/local/httpd2/conf/httpd.conf
1038行的内容为: LoadModule php5_module modules/libphp5.so
将这一行的注释就没有问题
/usr/local/httpd2/modules/libphp5.so 文件也存在, 就是不知道为什么不能加载!
----------------------------------------------------------------------------
诚请高手帮忙,谢谢!~