Apache-mysql-php安装

redhat linux 9.0
apache2.2.3源码安装过程
下载到/usr/src目录,解压缩,解档
root# cd httpd.2.2.3
root# ./configure –prefix=/usr/local/apache2 –enable-ssl –enable-rewrite –enable-speling
root# make
root# make install
root# /usr/local/apache2/bin/apachectl -k start
root# /usr/local/apache2/bin/apachectl -k stop
root# /usr/local/apache2/bin/apachectl -k restart    or  killall -HUP httpd

/usr/local/apache2/bin/httpd -l 查看已安装的模块

————————————————————————
mysql-5.0.22安装手册

#groupadd mysql
#useradd -g mysql mysql
#tar zxvf mysql-5.0.22.tar.gz    /*会生成一个mysql-5.0.22的目录*/
#cd mysql-5.0.22
#./configure –prefix=/usr/local/mysql
#make
#make install
#cp support-files/my-medium.cnf /etc/my.cnf    /*如果这时系统问是否覆盖重名文件,回答y*/
#cd /usr/local/mysql
#bin/mysql_install_db –user=mysql    /*以mysql用户建系统库,必须以mysql用户,这点很重要!*/
#chown -R root  .
#chown -R mysql var
#chgrp -R mysql .
#bin/mysqld_safe –user=mysql &    /*也要用mysql用户运行。
#Starting mysqld daemon with databases from /usr/local/mysql/var /*恭喜!成功了!*/
————————————————————————————-
pHP-4.4.4
系统自带是libxml2的版本是2.5.4的,在php配置的过程中报错,下载了一个更新的libxml2-2.6.12.tar.gz.
# cd /root
# tar zxvf libxml2-2.6.12.tar.gz
# cd libxml2-2.6.12
# ./configure
# make
# make install
1.解压缩后运行
# ./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=/usr/local/mysql
# make
# make test
# make install
# cp php.ini-dist /usr/local/lib/php.ini
2.编辑apache配置文件/etc/httpd.conf,增加php支持
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
LoadModule php4_module modules/libphp4.so    —系统已添加
DirectoryIndex index.php default.php index.htm index.html default.htm default.html  —添加首页默认文件
在网页根目录下增加一个测试页test.php

vi test.php
<?php
phpinfo () ;
?>
http://localhost/test.php

评论关闭。