0514-86177077
9:00-17:00(工作日)
第一步:系統(tǒng)與軟件的準備 系統(tǒng)版本 redhat enterprise linux 5 ,內核版本 2.6.18 系統(tǒng)安裝組件選擇:GNOME,圖形化互聯(lián)網,編輯器,開發(fā)工具,基本系統(tǒng),系統(tǒng)工具,管理工具,X窗口環(huán)境 (因為機器有限,要從本機測試,所以安裝GNOME和互聯(lián)網環(huán)境) 第二步:軟件包的準備 httpd軟件包:httpd-2.2.8.tar.bz2 mysql軟件包從mysql官方網站下載,我選用的是ehel5的rpm包 MySQL-server-community-5.0.51a-0.rhel5.i386.rpm MySQL-client-community-5.0.51a-0.rhel5.i386.rpm MySQL-devel-community-5.0.51a-0.rhel5.i386.rpm MySQL-shared-community-5.0.51a-0.rhel5.i386.rpm php5軟件包:php-5.2.5.tar.bz2 其他庫文件: curl-7.15.0.tar.gz freetype-2.3.5.tar.gz gd-2.0.35.tar.gz jpegsrc.v6b.tar.gz libpng-1.2.26.tar.gz libxml2-2.6.31.tar.gz PDFlib-7.0.3-Linux-php.tar.gz t1lib-5.0.0.tar.gz xpm-3.4k.tar.gz zlib-1.2.3.tar.gz gettext-0.16.tar.gz 其他管理軟件包: phpMyAdmin-2.11.6-rc1-all-languages.tar.gz webmin-1.410.tar.gz 第三步開始安裝:安裝的順序,httpd和mysql的安裝,從這個環(huán)境而言是無所謂的,只是php5軟件包要最后安裝,先安裝httpd 簡要步驟如下,#號提示符后面為命令,復制所有軟件包到一個位置,我這里是在/usr/local/src目錄下創(chuàng)建lamp目錄,然后復制所有軟件包到lamp下 #cd /usr/local/src/lamp #tar zxvf httpd-2.2.8.tar.bz2 #cd http-2.2.8 #./configure --prefix=/usr/local/apache2 --enable-rule=SHARED_CORE --enable-module=so #make #make install 安裝apache完成,輸入命令 #/usr/local/apache2/bin/apachectl -k start 從本地或其它機器打開Firefox瀏覽器(我的鐘愛),輸入地址http://你的服務器ip地址,記得開放服務器的80端口,不然可能會提示錯誤,如果正確的話會出現(xiàn)一個"It works !"的提示頁面,此時,apache2基本安裝完成。 接下來進行Mysql的安裝,我先安裝mysql-server的安裝包,提示需要perl-DBI包,從安裝光盤上即可找到,DVD安裝的直接就去光盤上的Server文件夾去找就可以了,如果是cd安裝,就去cd-2上去同樣的目錄。 #mount /dev/cdrw /media #rpm -ivh /media/Server/perl-DBI-1.52-1.fc6.i386.rpm 安裝完成后再依次安裝mysql的其他包 #rpm -Uvh MySQL-server-community-5.0.51a-0.rhel5.i386.rpm #rpm -Uvh MySQL-client-community-5.0.51a-0.rhel5.i386.rpm #rpm -Uvh MySQL-devel-community-5.0.51a-0.rhel5.i386.rpm #rpm -Uvh MySQL-shared-community-5.0.51a-0.rhel5.i386.rpm 安裝完成后修改mysql的root用戶密碼,默認為空,修改命令如下 #/usr/bin/mysqladmin -u root password '密碼字符串' 以后再從命令行登錄mysql的就輸入 #mysql -u root -p 會提示輸入密碼,Mysql的基本安裝完成。 接下來是其他庫文件的安裝,這些軟件包的安裝順序應該可以自由選擇(zlib在libpng前安裝),不過我認為可以先把Zlib安裝上,僅作參考。 我這次的順序就沒有先安裝zlib,就隨便選擇來安裝了,先是Curl, #tar zxvf curl-7.15.0.tar.gz #cd curl-7.15.0 #./configure --prefix=/usr/local/curl (我認為可以加上--with-zlib開關,只是這次我沒有用) #make #make install jpeg的安裝,jpeg不能自己創(chuàng)建安裝所需的目錄,要提前創(chuàng)建好 #mkdir -pv /usr/local/jpeg/{,bin,lib,include,man/man1,man1} #./configure --prefix=/usr/local/jpeg --enable-shared --enable-static #make #make install libxml2的安裝 #tar zxvf libxml2-2.6.31.tar.gz #cd libxml2 #./configure --prefix=/usr/local/libxml2 (可以嘗試打開zlib開關,--with-zlib) #make(時間可能稍微長些) #make install #cp xml2-config /usr/bin LibPDF的安裝 #tar zxvf PDFlib-7.0.3-Linux-php.tar.gz #cd pdflib #cp bind/php5/php520mt/libpdf-php.so /usr/local/lib/ (上面的php520mt目錄的同級目錄中有php503,php510,php520目錄,不知道是不是版本的區(qū)別) T1lib的安裝 #tar zxvf t1lib-5.0.0.tar.gz #cd t1lib #./configure --prefix=/usr/local/t1lib #make without-doc #make install Freetype的安裝 #tar zxvf freetype-2.3.5.tar.gz #cd freetype #./configure --prefix=/usr/local/freetype #make #make install Zlib的安裝 #tar zxvf zlib-1.2.3.tar.gz #./configure --shared #make #make install Libpng的安裝 #tar zxvf libpng-1.2.26.tar.gz #cd libpng #cp scripts/makefile.linux ./makefile #./configure --prefix=/usr/local/libpng #make #make install GDlib的安裝,可能會出現(xiàn) AM_ICON 的錯誤提示,此時需要安裝 gettext 軟件包 #tar zxvf gettext-0.16.tar.gz #cd gettext #./configure --prefix=/usr/local/gettext #make #make install(時間稍長) 接下來是gdlib的安裝 #tar zxvf gd-2.0.35.tar.gz #cd gd #./configure --with-png=/usr/local/lib \ --with-zlib=/usr/local/lib \ --with-freetype=/usr/local/freetype/lib \ --with-jpeg=/usr/local/jpeg/lib #make #make install PHP5的安裝 #tar zxvf php-5.2.5.tar.bz2 #cd php #./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs \ --enable-track-vars --with-sockets --enable-sockets --with-sysvshm --with-sysvsem \ --with-pdflib-dir=/usr/local/lib --with-jpeg-dir=/usr/local/jpeg \ --with-png-dir=/usr/local/lib --with-zlib-dir=/usr/local/lib \ --with-freetype-dir=/usr/local/freetype --with-curl=/usr/local/curl \ --with-libxml-dir=/usr/locallibxml2/lib --with-t1lib=/usr/localt1lib \ --with-gettext=/usr/localgettext/lib --with-gd --with-mysql (最好加上mbstring 和 mcypt ,不知道是不是必須) configure后如果成功會提示PHP歡迎界面: Thank you for using PHP. #make #make test (大約3000多項測試吧) # make install Php.ini文件的修改 #cp php.ini.dist /usr/local/lib/ 查找修改extension_dir='./'的內容 extension_dir = /usr/local/lib extension=libpdf_php.so 保存退出 最后修改apache配置文件httpd.conf #vi /usr/local/apache2/conf/httpd.conf 查找AddType 大約在DefaultType text/plain 輸入如下內容 AddType application/x-httpd-php .htm AddType application/x-httpd-php .html AddType application/x-httpd-php .phtml AddType application/x-httpd-php .php AddType application/x-httpd-php .php3 AddType application/x-httpd-php .php4 AddType application/x-httpd-php-source .phps (不清楚是不是必須輸入這么多項) 查找DirectoryIndex index.html 在其后輸入 index.php 保存文件,退出。 測試php,創(chuàng)建info.php文件放到網站的目錄下,我這里是/usr/local/apapche2/htdocs 內容如下
標簽:西雙版納 涼山 焦作 南平 儋州 大慶 遼源 撫順
上一篇:Linux系統(tǒng)下安裝phpmyadmin方法
下一篇:Linux和Windows雙系統(tǒng)Grub丟失恢復
Copyright ? 1999-2012 誠信 合法 規(guī)范的巨人網絡通訊始建于2005年
蘇ICP備15040257號-8