自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

詳解 Qt 數(shù)據(jù)庫環(huán)境配置

移動開發(fā)
本文介紹的是Qt數(shù)據(jù)庫環(huán)境配置,以前接觸的都是VS2008、VS2005等,多的不說了,先來看內(nèi)容。

本文介紹的是Qt 數(shù)據(jù)庫環(huán)境配置,環(huán)境配置:Qt 4.2.3 + ZendOptimizer + mbstring + mcrypt + GD庫 。

一、安裝RedHat Linux Array.0

安裝系統(tǒng)時請務必安裝開發(fā)工具包和KDE開發(fā)工具包,WWW服務器和SQL服務器不要安裝,否則可能會出現(xiàn)未知的錯誤。

二、確定linux系統(tǒng)是否安裝gcc編譯器

&#6527Array;&#6527Array;首先,服務器GCC要有,不然什么都不能做.可以用gcc -v來查看是否安裝了GCC,

  1. #gcc -v  
  2. Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs  
  3. Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
  4.   --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking
  5.   --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux  
  6. Thread model: posix  
  7. gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-34) 

有以上類似信息說明已有GCC,如果你沒有,請先拿安裝光盤裝好它。

三、請下載以下所有的東西

  1. httpd-2.2.4.tar.gz  
  2. MySQL-client-5.0.37-0.i386.rpm  
  3. MySQL-server-5.0.37-0.i386.rpm  
  4. MySQL-devel-5.0.37-0.i386.rpm  
  5. php-5.2.1.tar.gz  
  6. ZendOptimizer-3.2.4-linux-glibc21-i386.tar.gz  
  7. gd-2.0.28.tar.gz  
  8. libxml2-2.6.11.tar.gz  
  9. zlib-1.2.1.tar.gz  
  10. jpegsrc.v6b.tar.gz  
  11. libpng-1.2.5.tar.gz  
  12. xpm-3.4k-2.i386.rpm  
  13. gd-devel-1.8.4-11.i386.rpm  
  14. libmcrypt-2.5.7.tar.gz  
  15. qt-x11-opensource-src-4.2.3.tar.gz 

可能你的電腦不需要這么多.但***都下載吧.不過,可能你看到這貼子的時候會有以上軟件新的版本下載了.看著辦吧.

開始裝吧>>>>>>>>>>>>>>>>>>>>>>>>>

推薦一個下載軟件包的網(wǎng)址:http://www.filewatcher.com/

四、安裝MYSQL 服務器

  1. #rpm -ivh MySQL-server-5.0.37-0.i386.rpm  
  2. #rpm -ivh MySQL-client-5.0.16-0.i386.rpm  
  3. #rpm -ivh MySQL-devel-5.0.16-0.i386.rpm(沒有它不能安裝php5.2.1) 

安裝好后試試能不能用

  1. #mysql  
  2. Welcome to the MySQL monitor. Commands end with ; or \g.  
  3. Your MySQL connection id is 27651 to server version: 4.0.20-standard  
  4. Type ’help;’ or ’\h’ for help. Type ’\c’ to clear the buffer. 

說明OK,請自己改mysql的密碼SET PASSWORD=PASSWORD(’密碼’);

五、安裝GD庫基本包

  1. #rpm -ivh gd-devel-1.8.4-11.i386.rpm 

六、安裝XPM支持

  1. #rpm -ivh xpm-3.4k-2.i386.rpm 

#p#

七、安裝libxml2 (記得PHP5.2.1只支持libxml2-2.6.11以上版本)

  1. #tar zxvf libxml2-2.6.11.tar.gz  
  2. #cd libxml2-2.6.11  
  3. #./configure  
  4. #make  
  5. #make install 

八、裝GD庫支持

(1)安裝ZLIB

  1. #tar zxvf zlib-1.2.1.tar.gz  
  2. #cd zlib-1.2.1  
  3. #./configure  
  4. #make  
  5. #make install  
  6. (2)安裝JPEGSRC  
  7. #tar zxvf jpegsrc.v6b.tar.gz  
  8. #cd jpegsrc-6b  
  9. #./configure  
  10. #make  
  11. #make install-lib  
  12. #make install 

(3)安裝LIBPNG

  1. #tar zxvf libpng-1.2.5.tar.gz  
  2. #cd libpng-1.2.5  
  3. #cp scripts/makefile.std Makefile  
  4. #make  
  5. #make install 

(4)***是安裝GD2.*

  1. gd-2.0.28  
  2. #tar zxvf gd-2.0.28.tar.gz  
  3. #cd gd-2.0.28  
  4. #./configure --with-png=/usr/local --with-jpeg=/usr/local --with-freetype=/usr  
  5. #make  
  6. #make install 

上面一切都很順利的話,GD就算成功的安裝上了. 如果有問題,應該是缺少支持包,總之是少什么就下載什么來安裝上.

九、安裝mcrypt

  1. #tar xzvf libmcrypt-2.5.7.tar.gz  
  2. #cd libmcrypt-2.5.7  
  3. #./configure  
  4. #make  
  5. #make install 

十、安裝APAHCHE2

  1. #tar zxvf httpd-2.2.4.tar.gz  
  2. #cd httpd-2.2.4  
  3. #./configure --prefix=/usr/local/apache2 --enable-module=so 
  4. #make  
  5. #make install 

#p#

十一、安裝PHP5

  1. #tar zxvf php-5.2.1.tar.gz  
  2. #cd php-5.2.1  
  3. #./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs 
  4. --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-gd=/usr/local --enable-trace-vars
  5.   --with-zlib-dir=/usr/local --with-mysql=/var/lib/mysql --with-mcrypt=/usr/local --enable-mbstring  
  6. #make  
  7. #make install 

我是把他們分別安裝在/usr/local/apache2 & PHP目錄下的所有的安裝工作做好了,接著我們來配置.

#p#

十二、Apache2配置

(1)復制PHP.INI文件到正確位置,在PHP解壓的目錄下運行

  1. #cp php.ini-dist /usr/local/php/lib/php.ini 

(2)編輯apache配置文件httpd.conf

  1. #vi /usr/local/apache2/conf/httpd.conf 

要改的有如下幾處:

一般都在

  1. #AddType application/x-tar .tgz 

下加一行

  1. AddType application/x-httpd-php .php 

還有找到

  1. DirectoryIndex index.html index.html.var 

在后面加 index.php 讓它把index.php做為默認頁

再找

  1. #ServerName 

把#去掉,后面的IP改成你的IP.

找到

  1. 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

  1. # /usr/local/apache2/bin/apachectl start 

如果沒有出錯,寫一個測試頁放到你網(wǎng)頁目錄下, 我的就是上面所說的 /myweb

  1. #vi /home/easy/index.php 

保存.試試在測試器里打IP進去就可以看到PHPINFO頁了

好了.如無意外.你現(xiàn)在可以放心在你的機器上運行PHP腳本連接mysql了.

#p#

十二、安裝ZendOptimizer-3.2.4加速PHP

  1. #tar zxvf ZendOptimizer-3.2.4-linux-glibc21-i386.tar.gz  
  2. #cd ZendOptimizer-3.2.4-linux-glibc21-i386  
  3. #./install.sh 

一路默認下去應該就好了.再看看測試頁,看看末尾是不是這樣的?

  1. This program makes use of the Zend Scripting Language Engine:  
  2. Zend Engine v1.3.0, Copyright (c) 1ArrayArray8-2004 Zend Technologies with Zend Extension Manager v1.0.3,
  3.  Copyright (c) 2003-2004, by Zend Technologies with Zend Optimizer v3.2.4, Copyright (c) 1ArrayArray8-2004, by Zend Technologies 

十三、安裝phpMyAdmin

  1. #unzip -d . phpMyAdmin-2.10.0.2-all-languages-utf-8-only.zip  
  2. #mv phpMyAdmin-2.10.0.2-all-languages-utf-8-only /usr/local/apache2/htdocs/phpMyAdmin  
  3. #cd /usr/local/apache2/htdocs/phpMyAdmin  
  4. #cp library/config.default.php config.inc.php  
  5. #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

  1. #tar xzvf qt-x11-opensource-src-4.2.3.tar.gz  
  2. #cd qt-x11-opensource-src  
  3. #./configure --qt-sql-mysql --qt-sql-sqlite --plugin-sql-mysql --plugin-sql-sqlite -I/usr/include/mysql -L/usr/lib/mysql  
  4. #gmake  
  5. #make install  
  6. #echo "export PATH=/usr/local/Trolltech/Qt-4.2.3/bin:$PATH" >> ~/.bashrc 

小結(jié):Qt數(shù)據(jù)庫環(huán)境配置的內(nèi)容介紹完了,希望本篇對你有幫助,想要更多內(nèi)容,請參考編輯推薦。

責任編輯:zhaolei 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2011-08-30 13:59:06

QTMysql數(shù)據(jù)庫

2011-06-21 15:48:41

2011-06-21 15:58:20

Qt 數(shù)據(jù)庫

2011-08-15 23:14:34

Oraclerman環(huán)境配置

2010-04-02 13:59:08

Oracle數(shù)據(jù)庫

2011-07-05 09:54:04

2011-07-01 14:06:57

Qt sqlite

2011-08-30 14:25:06

QT數(shù)據(jù)庫

2011-07-05 10:03:00

Qt MYSQL 數(shù)據(jù)庫

2011-08-30 14:38:50

QT數(shù)據(jù)庫

2011-09-01 15:10:22

Qt數(shù)據(jù)庫SQL

2011-07-05 09:35:52

Ubuntu Qt Mysql

2011-07-05 14:46:34

2010-04-02 17:11:45

Oracle數(shù)據(jù)庫

2010-03-16 14:05:19

Cassandra

2011-06-21 15:11:04

QT 數(shù)據(jù)庫

2011-06-21 15:31:04

Qt 數(shù)據(jù)庫 SQL

2011-07-05 10:16:16

Qt 數(shù)據(jù)庫 SQLite

2011-07-20 12:34:49

SQLite數(shù)據(jù)庫約束

2010-04-14 15:14:11

Oracle數(shù)據(jù)庫
點贊
收藏

51CTO技術(shù)棧公眾號