安装时的问题:
Q:httpd: could not open document config file /usr/local/apache/conf/httpd.conf
A:Try manually starting your server with the -f option pointing to the location of your
httpd.conf.
httpd -f /httpd.conf.
If that works then you need to change your .rc files to include the -f option.
Q:# ./httpd -f /usr/local/apache2/conf/httpd.conf
./httpd: error while loading shared libraries: libaprutil-0.so.0: cannot open shared object
file: No such file or directory
A: vi /etc/ld.so.conf,增加/usr/local/apache2/lib 或者
# cp libaprutil-0.so.0 /usr/kerberos/lib
或者创建/usr/local/apache/conf目录,ln -s /usr/local/apache2/conf/httpd.conf
/usr/local/apache/conf/httpd.conf
vi /usr/local/apache2/conf/httpd.conf
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
#/usr/local/apache2/bin/apachectl restart
测试php:
vi /usr/loacl/apache2/conf/httpd.conf
默认把php文件放在/var/www下
更改DocumentRoot "/var/www"
安装时碰到的问题:
Q:configure: error: Cannot find MySQL header files under yes.
A:编译的时候指定mysql的路径 /usr/local/mysql
//重新编译
#make clean
#./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql
Q:# ./apachectl start
Syntax error on line 1070 of /usr/local/apache2/conf/httpd.conf:
Cannot load /usr/local/apache2/modules/libphp5.so into server:
/usr/local/apache2/modules/libphp5.so: undefined symbol: sqlite3SelectDelete
A:# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs
--with-mysql=/usr/local/mysql --with-zlib
Q:# /usr/local/apache2/bin/apachectl restart
Syntax error on line 1051 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache2/libexec/libphp5.so into server:
/usr/local/apache2/libexec/libphp5.so: cannot open shared object file: No such file or
directory
A:可以先查找系统是否有libphp5.so,如果没有则重新编译php