apache2、mysql4与php4整合安装

王朝厨房·作者佚名  2007-01-05
窄屏简体版  字體: |||超大  

一、系统环境

本系统为:Red Hat Linux----Advanced Server release 2.1AS

此安装也适合与Red Hat Linux 9.0

二、安装

2.1、源代码(请自行下载,版本相差不远关系不大)

mysql-4.x.tar.gz

httpd-2.x.tar.gz

php-4.x.tar.gz

2.2、安装mysql

请参照mysql时的安装文档:INSTALL-BINARY来安装,里面的详尽的说明。

shell> groupadd mysql

shell> useradd -g mysql mysql

shell> cd /usr/local

shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -

shell> ln -s full-path-to-mysql-VERSION-OS mysql

shell> cd mysql

shell> scripts/mysql_install_db

shell> chown -R root .

shell> chown -R mysql data

shell> chgrp -R mysql .

shell> bin/safe_mysqld --user=mysql &

or

shell> bin/mysqld_safe --user=mysql &

if you are running MySQL 4.x

2.3、安装apache2

shell> tar zxvf apache2.x.tar.gz

shell> cd httpd-2.x

shell> ./configure

shell> make

shell> make install

apache2.x安装完成

2.4、安装php4

shell> tar zxvf php-4.x.tar.gz

shell> cd php-4.x

shell> ./configure --with-mysql --with-apxs2=/usr/local/apache2/bin/apxs --enable-versioning --disable-debug --enable-track-vars

shell> make

shell> make install

--with-mysql 表示支持mysql

其中--with-apxs2=/usr/local/apache2/bin/apxs一定不能少,这个参数把php以动态模块的方式安装到apache下

2.5、配置httpd.conf

shell> cd /usr/local/apache/conf

shell> vi httpd.conf

加入两行:

LoadModule php4_module modules/libphp4.so

AddType application/x-httpd-php .php

修改Listen x.x.x.x:80

x.x.x.x是你本机的IP

三、启动:

/usr/local/apache/bin/apachectl start

四、测试:

在/usr/local/apache/htdocs下

编辑index.php

<?phpinfo();?>

在Mozilla中输入http://x.x.x.x/index.php

可以看见熟悉的php的表以及信息。

本人刚安装完,测试没有问题,大家如有什么问题,可用QQ与我交流。我的QQ是:36117798

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航