apache php用什么linux
发布网友
发布时间:2022-11-23 19:47
我来回答
共1个回答
热心网友
时间:2024-12-14 05:43
准备工作:httpd-2.2.21.tar.gz, php-5.2.6.tar.gz, libxml2-2.6.32.tar.gz
安装Apache2.2.21
#tar -zxvf httpd-2.2.21.tar.gz
# cd httpd-2.2.21
# ./configure--prefix=/usr/local/apache
# make
# sudo make install
在httpd.conf文件中添加(或修改): ServerName 127.0.0.1
启动Apache服务
#/usr/local/apache/bin/apachectl start
关闭Apache服务
#/usr/local/apache/bin/apachectl stop
重启Apache服务
#/usr/local/apache/bin/apachectl restart
安装libxml2(安装php需要libxml2做支持,所以需要先安装libxml2)
#tar -zxvf libxml2-2.6.32.tar.gz
# cd libxml2-2.6.32
#./configure --prefix=/usr/local/libxml2
# make
# sudo makeinstall
3.安装PHP5.2.6
#tar -zxvf php-5.2.6.tar.gz
# cd php-5.2.6
# ./configure--prefix=/usr/local/php
--with-libxml-dir=/usr/local/libxml2
--with-apxs2=/usr/local/apache/bin/apxs
#make
# sudo make install
# cp php.ini-dist /usr/local/php/lib/php.ini
4.配置Apache服务的httpd.conf文件
*在LoadMole处添加LoadMole php5_mole mole/libphp5.so
*在AddTypeapplication处添加AddType application/x-httpd-php .php
#/usr/local/apache/bin/apachectl restart
重启apache如果出现httpd:Syntax error on line 53 of /usr/devsoft/apache/conf/httpd.conf:Cannot load /usr/devsoft/apache/moles/libphp5.so into server:/usr/devsoft/apache/moles/libphp5.so: undefined symbol:sqlite3ExprDelete报这种错误一般是编译、链接出错,应该是不需要sqlite的.所以需要重新编译php,./configure时加--without-sqlite--without-pdo-sqlite