一、软件获取
apache_1.3.6.tar.gzphp-3.0.8.tar.gzmysql-3.22.21-pc-linux-gnu-i686.
tar.gzphpMyAdmin_2.0.1.tar.gz 从http://www.htmlwizard.net/phpMyAdmin/取
得注意:以上均为源代码而非RPM包
二、软件安装
以root登录,将以上文件均拷贝至/root下1.安装MySQL
#tar -zvxf mysql-3.22.21-pc-linux-gnu-i686.tar.gz 产生mysql-3.22.
21-pc-linux-gnu-i686目录#mv mysql-3.22.21-pc-linux-gnu-i686
/usr/local/mysql 移到/usr/local/mysql#cd /usr/local/mysql#./configure
--prefix=/usr/local/mysql#cdMySQL安装完毕(我下载的是bin包)
2.安装Apache及php3
#tar xvzf apache_1.3.6.tar.gz 产生apache_1.3.6目录#tar xvzf php-3.
0.8.tar.gz 产生php-3.0.8目录#cd apache_1.3.6#./configure
--prefix=/usr/local/apache 把Apache的安装目录定为/usr/local/apache#cd .
./php-3.0.8#./configure --with-mysql=/usr/local/mysql --with-apache=..
/apache_1.3.6 --enable-track-vars
配置支持MySQL、作为Apache功能模块、跟踪变量有效#make; make
installPHP安装完毕#cd ../apache_1.3.6#./configure
--prefix=/usr/local/apache --activate-module=src/modules/php3/libphp3.
a#make; make installAPACHE安装完毕#cd ../php-3.0.8#cp php3.ini-dist
/usr/local/lib/php3.ini 把php.ini文件拷到/usr/local/lib/目录下.#cd
/usr/local/apache/conf#vi httpd.conf找到AddType application/x-httpd-php3
.php3把它前头的#号给删了当然也可加一行AddType
application/x-httpd-php3 .asp这样用FrontPage编辑会方便一点3.安装
phpMyAdminL
#cd#tar -zvxf phpMyAdmin_2.0.1.tar.gz 产生phpMyAdmin-2.0.1目录#mv
phpMyAdmin_2.0.1 /usr/local/apache/htdocs/phpMyAdmin 移到
/usr/local/mysql#cd /usr/local/apache/htdocs/phpMyAdmin#chmod a+r * 置为
可读
三、软件运行
启动MySQL#cd /usr/local/mysql/#bin/safe_mysqld &测试:
#bin/mysql -u root 默认没有设口令mysql>use mysql 打开mysql数据库
mysql>select * from user; 从表user中读数据,别忘加;号mysql>exit这样就算
可以了,先不急着加口令
启动Apache/usr/local/apache/bin/apachectl start测试:
#telnet localhost 80Trying 127.0.0.1...Connected to localhost.Escape
character is '^]'.HEAD / HTTP /1.1 输入并加两次回车
HTTP/1.1 200 OKDate: Wed, 23 Jun 1999 02:51:27 GMTServer: Apache/1.
3.6 (Unix) PHP/3.0.8Last-Modified: Wed, 20 May 1998 14:59:42 GMTETag:
"2e341-656-3562efde"Accept-Ranges: bytesContent-Length: 1622Connection:
closeContent-Type: text/htmlX-Pad: avoid browser bug
Connection closed by foreign host
再用浏览器测试一下吧#cd /usr/local/apache/htdocs#vi test.php3在文件
里敲入:
并存盘退出再用浏览器看一下这个文件,是不是一大串信息出来了?
使用phpMyAdmin用浏览器打开/phpMyAdmin/index.php3 注意大小写
四、MySQL及phpMyAdmin的使用
1.MySQL的用户及口令设置
#cd /usr/local/mysql#bin/mysqladmin -u root password '新口令
'#bin/mysql -u root -pEnter password: 输入口令mysql>use
mysqlmysql>update user set select_priv='y'; 使任何人均可读数据库
mysql>flush privileges; 使设置有效mysql>exit其它设置请参见相关文档
2.phpMyAdmin设置
设置口令后,phpMyAdmin也要作相关设置:
#cd /usr/local/apache/htdocs/phpMyAdmin#vi config.inc.php3将第8行改
为$cfgServers[1]['adv_auth'] = true; //这样会问用户名和口令将第47行改为
$cfgMysqladmin = "/usr/local/mysql/bin/mysqladmin"; //用于重新启动MySQL
将第59行改为require("chinese_gb.inc.php3"); //简体中文显示存盘退出用浏览
器打开/phpMyAdmin/index.php3 注意大小写
这下好了,都是亲切的中文提示....
[目录]
--------------------------------------------------------------------------------
apache+php3+mysql
================================================================================
*安装apache-devel rpm包.
*安装MySQL相关的包.
rpm -ivh MySQL-3.22.25-1.i386.rpm
rpm -ivh MySQL-client-3.22.25-1.i386.rpm
rpm -ivh MySQL-devel-3.22.25-1.i386.rpm
*下载php3源文件php-3.0.tar.gz
*解开源文件
tar xzvf php-3.0.tar.gz
*进入php-3.0源文件目录
./configure --with-mysql=/usr --with-apxs=/usr/sbin/apxs --with-config-file
-path=/etc/httpd (还有其他选项,可以运行 ./configure --help 看看)
*建一个modules目录
mkdir modules
*进入regex目录
运行 make r (这一步可能不必要)
运行 make lib
*退回上一级目录
运行 make install
* cp modules/libphp3.so /etc/httpd/modules/
* cp php3.ini-dist /etc/httpd/php3.ini
* 修改/etc/httpd/conf/httpd.conf 加入
LoadModule php3_module modules/libphp3.so
AddModule mod_php3.c
修改/etc/httpd/conf/srm.conf 加入
AddType application/x-http-php3 .php3
*重起apache
/etc/rc.d/init.d/httpd restart
*测试
查看mysqld是否已经运行.如果没有,先运行mysqld
将php3源文件下tests目录下的mysql文件拷贝到 /home/httpd/html目录下
lynx localhost/mysql.php3
如果有问题,可以将mysql.php3中的127.0.0.1改为localhost