|
2005/11/6-10:47:43 |
基本安裝 如果是Linux 用戶,先確定是否已安裝MySQL RPM,如果有,請將它移除: Shell# rpm -qa|grep mysql Shell# rpm -e mysql 套件名稱 註:若有資料庫請先將它備份 取回來的軟體通常是壓縮檔,先以root 身份將軟體解壓 Shell# cd /root Shell# gunzip < mysql-3.23.36.tar.gz | tar xvf - ( Shell# tar -zxvf mysql-3.23.36.tar.gz) 設定安裝組態 Shell# cd mysql-3.23.36 Shell# ./configure --prefix=/usr/local/mysql -with-charset=big5 (如果有其他設定方面的問題可輸入configure --help 顯示設定說明。) 編譯及安裝 Shell# make Shell# make install 建立MySQL 初始化Table Shell# scripts/mysql_install_db 說明:建立MySQL Grant Table,第一次安裝MySQL 都必須執行這個指令 複製my.cnf (my.cnf 為mysql daemon 起動設定檔) Shell# cp support-files/my-medium.cnf /etc/my.cnf 建立mysql 群組以及使用者,並以mysql 的身份起動server Shell# groupadd mysql Shell# useradd mysql -g mysql hell# chown -R root /usr/local/mysql Shell# chown -R mysql /usr/local/mysql/var Shell# chgrp -R mysql /usr/local/mysql Shell# /usr/local/mysql/bin/safe_mysqld --user=mysql & 測試MySQL Server 是不是有正常運作 Shell# /usr/local/mysql/bin/mysqladmin version Shell# /usr/local/mysql/bin/mysqladmin variables 開機自動執行MySQL Server 修改 /etc/rc.d/rc.local,加入 /bin/sh -c 'cd /usr/local/mysql ; ./bin/safe_mysqld --user=mysql &' 安裝APACHE+PHP 安裝延伸軟體(若要PHP 能使用GD、Freetype 等函式庫,須先它們將編譯 或安裝好) 一、GD(原始檔編譯安裝) # tar -zxvf gd.1.3.tar.gz # cd gd.1.3# make 二、Freetype(用rpm 安裝之) # rpm -ivh freetype-2.0.1.CLE.rpm # rpm -ivh freetype-devel-2.0.1.CLE.rpm 注意:若系統已有上述RPM 檔,可先將它們移除 如果是Linux 用戶,先查看是否有安裝Apache 或PHP RPM,如果有, 請將它們移 Shell# rpm -qa|grep apache Shell# rpm -e apache 套件名稱 Shell# rpm -qa|grep php Shell# rpm -e php 套件名稱 注意:若系統有正在運作的APACHE SERVER,請先將httpd.conf 備份起來 2.先將軟體解壓縮 Shell# cd /root Shell# gunzip < php-4.0.5.tar.gz | tar xvf - Shell# gunzip < apache_1.3.19.tar.gz | tar xvf - 3.設定apache 安裝目錄 Shell# cd apache_1.3.19 Shell# ./configure --prefix=/home/www 4.設定PHP 安裝選項 Shell# cd ../php-4.0.5 Shell# ./configure \ --with-apache=../apache_1.3.19 \ --with-mysql=/usr/local/mysql \ --with-openssl --with-gd=../gd1.3 --with-ttf \ ◎ 選項--with-apache=../apache_1.3.19 表示apache 原始目錄 ◎ --with-mysql=/usr/local/mysql 表示使用mysql ◎ --with-gd=../gd1.3 表示使用gd 函式庫(gd1.3 為gd 安裝目錄) ◎ --with-openssl 支援OpenSSL(需有openssl 套件) ◎ --with-ttf 支援freetype 5.編譯及安裝PHP Shell# make Shell# make install 6.編譯Apache Shell# cd ../apache_1.3.19 Shell# ./configure --activate-module=src/modules/php4/libphp4.a Shell# make Shell# make install 7.複製PHP 設定檔 Shell# cp /root/php-4.0.5/php.ini.dist /usr/local/lib/php.ini 8.修改Apache 設定檔httpd.conf,加入或修改下列設定: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps 9.重新啟動Apache Shell# /home/www/bin/apachectl restart 10.測試 在WWW 的網頁目錄下,寫一測試檔 test.php,內容為 可顯示php 的環境內容表示 php 的安裝成功了 |
|
|
|
|