所需軟件
php4.03源程序 C語言代碼 mysql3.23 alpha源程序 apache 1.3.11源程序 phpmyadmin_2.0.5 管理MYSQL數(shù)據(jù)庫的最佳工具 第一步 下載所需程序,安裝MYSQL3.23程序。
su為root新建一目錄為程序安裝的目錄如 /server 在server下建目錄mysql ,apache, 將上面3個文件下載到/usr/src/下.
運行如下指令解開文件包
tar -zxvf php-4.0b3.tar.gz tar -zxvf mysql-3.23.9-alpha.tar.gz tar -zxvf apache_1.3.11.tar.gz 將phpmyadmin下載到/server下
同樣運行 tar -zxvf phpMyAdmin_2.0.5.tar.gz
cd /usr/src/mysql-XXXX 這里XXXX是程序的版本號,下同,系統(tǒng)必需已安裝C開發(fā)庫
./configure -help ./configure -prefix=/server/mysql make make install cd /server/mysql/bin ./mysql_install_db 到這mysql已安裝成功!
可以運行mysql數(shù)據(jù)庫
/server/mysql/libexec/mysqld &
可以通過數(shù)據(jù)庫查看程序mysqlshow查看數(shù)據(jù)庫當(dāng)前的狀態(tài)
/server/mysql/bin/mysqlshow
第二步 安裝apache及php4。
如果系統(tǒng)中已有apache運行先關(guān)閉此服務(wù)
killall httpd
編譯apache及php4, 每一個行號為一行
cd /usr/src/apache_1.3.x ./configure --prefix=/server/apache cd ../php-4.0.x ./configure --with-mysql=/server/mysql --with-apache=../apache_1.3.x --enable-track-vars make make install cd ../apache_1.3.x ./configure --prefix=/server/apache --activate-module=src/modules/php4/libphp4.a make make install cd ../php-4.0.x cp php.ini-dist /usr/local/lib/php.ini apache及php4已安裝成功,下面配置apache及php4
配置php4 php4的配置文件為/usr/local/lib/php.ini文件
可以用vi 來編輯,如果你安裝了MC也可以用MC來編輯
在[mysql]下修改
mysql.default_port = 3306 mysql.default_host = localhost mysql.default_user = root
保存文件。
配置apache apache的配置文件為/server/apache/conf/httpd.conf
去掉 #AddType application/x-httpd-php .php 行的注冊號"#"加入行 AddType application/x-httpd-php .php3 保存文件。
配置phpmyadmin_2.0.5 在/server/phpmyadmin_2.0.5下找到config.inc.php3文件 從第10行起修改如下 $cfgServers[1]['host'] = 'localhost'; $cfgServers[1]['port'] = '3306'; $cfgServers[1]['adv_auth'] = false; $cfgServers[1]['stduser'] = 'root'; $cfgServers[1]['stdpass'] = ''; $cfgServers[1]['user'] = 'root'; $cfgServers[1]['password'] = ''; $cfgServers[1]['only_db'] = ''; $cfgServers[1]['verbose'] = '';
修改第65行 require("english.inc.php3");為 require("chinese_gb.inc.php3"); 保存此文件。
啟動apache /server/apache/bin/apachectl start
第三步 測試
在/server/apache/htdocs/下鏈接目錄/server/phpMyAdmin_2.0.5為admin 在流覽器中打開http://localhost/admin/index.php3 這時該能連接到MYSQL的數(shù)據(jù)庫中,你可以對數(shù)所庫進行操作。這表明整個系統(tǒng)以能正常工作。 你也可以新建立一個php文件如下
文件名 info.php
//查看系統(tǒng)狀況 文件開始
< ? phpinfo();?>
//文件結(jié)束
在流覽器中訪問此頁時你將得到有關(guān)PHP的運行資料.
注.本文中所有內(nèi)容都在文中有關(guān)的平臺上運行通過,不同的PHP版本可能會有所不同。
|