深度解析 Qt 數(shù)據(jù)庫環(huán)境配置 下篇
繼續(xù)為大家介紹,接著 深度解析 Qt 數(shù)據(jù)庫環(huán)境配置 上篇 ,同樣看以下代碼。
一、安裝XPM支持
- #rpm -ivh xpm-3.4k-2.i386.rpm
安裝libxml2 (記得PHP5.2.1只支持libxml2-2.6.11以上版本)
- #tar zxvf libxml2-2.6.11.tar.gz
- #cd libxml2-2.6.11
- #./configure
- #make
- #make install
二、裝GD庫支持
(1)安裝ZLIB
- #tar zxvf zlib-1.2.1.tar.gz
- #cd zlib-1.2.1
- #./configure
- #make
- #make install
(2)安裝JPEGSRC
- #tar zxvf jpegsrc.v6b.tar.gz
- #cd jpegsrc-6b
- #./configure
- #make
- #make install-lib
- #make install
(3)安裝LIBPNG
- #tar zxvf libpng-1.2.5.tar.gz
- #cd libpng-1.2.5
- #cp scripts/makefile.std Makefile
- #make
- #make install
(4)***是安裝GD2.*
- gd-2.0.28
- #tar zxvf gd-2.0.28.tar.gz
- #cd gd-2.0.28
- #./configure --with-png=/usr/local --with-jpeg=/usr/local --with-freetype=/usr
- #make
- #make install
上面一切都很順利的話,GD就算成功的安裝上了. 如果有問題,應(yīng)該是缺少支持包,總之是少什么就下載什么來安裝上.
三、安裝mcrypt
- #tar xzvf libmcrypt-2.5.7.tar.gz
- #cd libmcrypt-2.5.7
- #./configure
- #make
- #make install
四、安裝APAHCHE2
- #tar zxvf httpd-2.2.4.tar.gz
- #cd httpd-2.2.4
- #./configure --prefix=/usr/local/apache2 --enable-module=so
- #make
- #make install
五、安裝PHP5
- #tar zxvf php-5.2.1.tar.gz
- #cd php-5.2.1
- #./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs
- --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-gd=/usr/local
- --enable-trace-vars --with-zlib-dir=/usr/local --with-mysql=/var/lib/mysql --with-mcrypt=/usr/local --enable-mbstring
- #make
- #make install
我是把他們分別安裝在/usr/local/apache2 & PHP目錄下的所有的安裝工作做好了,接著我們來配置.
六、Apache2配置
(1)復(fù)制PHP.INI文件到正確位置
在PHP解壓的目錄下運行
- #cp php.ini-dist /usr/local/php/lib/php.ini
(2)編輯apache配置文件httpd.conf
- #vi /usr/local/apache2/conf/httpd.conf
要改的有如下幾處:,一般都在
- #AddType application/x-tar .tgz
下加一行
- AddType application/x-httpd-php .php
還有找到
- DirectoryIndex index.html index.html.var
在后面加 index.php 讓它把index.php做為默認(rèn)頁,再找
- #ServerName
把#去掉,后面的IP改成你的IP.,找到
- DocumentRoot "/usr/local/apache2/htdocs"
把/usr/local/apache2/htdocs改為你存放網(wǎng)頁文件的路徑
比如我是放在/myweb目錄下,所以我以后上傳PHP文件就放在/myweb目錄下,然后用IP訪問,就能看到首頁了,差不多就這些了,至于apache2其它優(yōu)化,請看 http://www.phpv.net/ 里的apache配置那一分類.,保存httpd.conf文件.
(3)啟動Apache2
- # /usr/local/apache2/bin/apachectl start
如果沒有出錯,寫一個測試頁放到你網(wǎng)頁目錄下, 我的就是上面所說的 /myweb
- #vi /home/easy/index.php
保存.試試在測試器里打IP進去就可以看到PHPINFO頁了,好了.如無意外.你現(xiàn)在可以放心在你的機器上運行PHP腳本連接mysql了.
七、安裝ZendOptimizer-3.2.4加速PHP
- #tar zxvf ZendOptimizer-3.2.4-linux-glibc21-i386.tar.gz
- #cd ZendOptimizer-3.2.4-linux-glibc21-i386
- #./install.sh
一路默認(rèn)下去應(yīng)該就好了.,再看看測試頁,,看看末尾是不是這樣的?
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.3, Copyright (c) 2003-2004, by Zend Technologies with Zend Optimizer v3.2.4, Copyright (c) 1998-2004, by Zend Technologies
八、安裝phpMyAdmin
- #unzip -d . phpMyAdmin-2.10.0.2-all-languages-utf-8-only.zip
- #mv phpMyAdmin-2.10.0.2-all-languages-utf-8-only /usr/local/apache2/htdocs/phpMyAdmin
- #cd /usr/local/apache2/htdocs/phpMyAdmin
- #cp library/config.default.php config.inc.php
- #vi config.inc.php
找到cfg['PmaAbsoluteUri']等號后面改為'http://localhost/phpMyAdmin'
找到cfg['blowfish_secrect]等號后面改為'MySQL數(shù)據(jù)庫root用戶密碼'
找到cfg['Server'][$i]['auth_type']等號后面改為'cookie'
找到$cfg['Servers'][$i]['user']等號后面改為'root'
找到cfg['Server'][$i]['password']等號后面改為'MySQL數(shù)據(jù)庫root用戶密碼'
找到$cfg['DefaultLang']等號后面改為 zh-gb2312
找到$cfg['DefaultCharset']等號后面改為 gb2312
測試:
在瀏覽器中輸入
- http://localhost/phpMyAdmin
輸入密碼后看看末尾mcrypt和mbstring擴展有沒有加載,如果沒有加載會有紅色警告提示。
九、安裝Qt4.2.3
- #tar xzvf qt-x11-opensource-src-4.2.3.tar.gz
- #cd qt-x11-opensource-src
- #./configure --qt-sql-mysql --qt-sql-sqlite --plugin-sql-mysql --plugin-sql-sqlite -I/usr/include/mysql -L/usr/lib/mysql
- #gmake
- #make install
- #echo "export PATH=/usr/local/Trolltech/Qt-4.2.3/bin:$PATH" >> ~/.bashrc
小結(jié):深度解析 Qt 數(shù)據(jù)庫環(huán)境配置的內(nèi)容為大家介紹完了,還是很希望本文會對你有幫助。