時(shí)間:2015-06-28 00:00:00 來源:IT貓撲網(wǎng) 作者:網(wǎng)管聯(lián)盟 我要評(píng)論(0)
以下的文章主要介紹的是在linux操作系統(tǒng)之下對(duì)Mysql+php5+apache安裝手記的具體描述,我前兩天在相關(guān)網(wǎng)站看見Mysql+php5+apache安裝手記的資料,覺得挺好,于是就拿出來供大家分享。
下載官方推薦的穩(wěn)定版本httpd-2.2.3.tar.gz,
安裝apache2
- #./configure?–prefix=/usr/local/apache2?–enable-module=alias?–enable-module=most?\ ?
- –enable-module=vhost_alias?–enable-shared=vhost_alias?–enable-module=so?–enable-shared=max?
- #?make;make?install?
下載目前最新穩(wěn)定版本mysql-standard-5.0.27-linux-i686-glibc23.tar.gz
無需安裝,解壓后移至/usr/local/mysql.
# groupadd mysql #建立mysql組
# useradd mysql -g mysql #建立mysql用戶并且加入到mysql組中
# cd /usr/local/mysql
然后設(shè)置權(quán)限
- #?chown?-R?root?.?#設(shè)定root能訪問/usr/local/mysql ?
- #?chown?-R?mysql?data?#設(shè)定mysql用戶能訪問/usr/local/mysql/data?,里面存的是mysql的數(shù)據(jù)庫(kù)文件 ?
- #?chown?-R?mysql?data/.?#設(shè)定mysql用戶能訪問/usr/local/mysql/data下的所有文件 ?
- #?chown?-R?mysql?data/mysql/.?#設(shè)定mysql用戶能訪問/usr/local/mysql/data/mysql下的所有文件 ?
- #?chgrp?-R?mysql?.?#設(shè)定mysql組能夠訪問/usr/local/mysql?
運(yùn)行mysql:
- #?/usr/local/mysql/bin/mysqld_safe?–user=mysql?&?
修改root密碼,默認(rèn)為空:
- /usr/local/mysql/bin/mysqladmin?-u?root?password?‘newpassword’?
MYSQL+php5+apache安裝完成
下載最新穩(wěn)定版本php-5.1.6.tar.gz,
1. 安裝zlib (安裝libpng和gd前需要先安裝zlib),
- #?tar?zxvf?zlib-1.2.3.tar.gz ?
- #?cd?zlib-1.2.3 ?
- #?./configure ?
- #?make;make?install?
2. 安裝libpng,
- #?tar?zxvf?libpng-1.2.12.tar.gz ?
- #?cd?libpng-1.2.12 ?
- #?./configure ?
- #?make;make?install?
3. 安裝freetype,
- #?tar?zxvf?freetype-2.2.1.tar.gz ?
- #?cd?freetype-2.1.10 ?
- #?./configure?–prefix=/usr/local/freetype ?
- #?make;make?install?
4. 安裝jpeg,
- #?tar?zxvf?jpegsrc.v6b.tar.gz ?
- #?cd?jpeg-6b ?
- #?mkdir?/usr/local/jpeg ?
- #?mkdir?/usr/local/jpeg/bin ?
- #?mkdir?/usr/local/jpeg/lib ?
- #?mkdir?/usr/local/jpeg/include ?
- #?mkdir?/usr/local/jpeg/man ?
- #?mkdir?/usr/local/jpeg/man/man1 ?
- #?./configure?–prefix=/usr/local/jpeg?–enable-shared?–enable-static ?
- #?make;make?install?
?5. 安裝gd,
- #?tar?zxvf?gd-2.0.33.tar.gz ?
- #?cd?gd-2.0.33 ?
- #?./configure?–prefix=/usr/local/gd?–with-jpeg=/usr/local/jpeg?–with-freetype=/usr/local/freetype?–with-png?–with-zlib?
Mysql+php5+apache編譯過程中會(huì)看到如下信息
** Configuration summary for gd 2.0.33:
- Support?for?PNG?library:?yes ?
- Support?for?JPEG?library:?yes ?
- Support?for?Freetype?2.x?library:?yes ?
- Support?for?Fontconfig?library:?no ?
- Support?for?Xpm?library:?no ?
- Support?for?pthreads:?yes?
可以看到png 、 jpeg 、 freetype都已經(jīng)安裝上了
- #?make ?
- #?make?install ?
6. 正式安裝php
- #?tar?zxvf?php-5.1.6.tar.gz ?
- #?cd?php-5.1.6 ?
- #?./configure?–prefix=/usr/local/php5?–with-apxs2=/usr/local/apache2/bin/apxs?–with-mysql=
/usr/local/mysql?–with-gd?–with-zlib?–with-png?–with-jpeg?–with-freetype?
–enable-sockets?–with-iconv?–enable-mbstring?–enable-track-vars?–enable-force-cgi-redirect?–with-config-file-path=/usr/local/php5/etc?
7.整合php和apache
- cp?php.ini-dist?/usr/local/php5/etc/php.ini ?
- vi?/usr/local/php5/etc/php.ini?
將extension=php_mysql.dll前面的#去掉
8. 安裝ZendOptimizer,
- #?tar?zxvf?ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz ?
- #?cd?ZendOptimizer-3.0.1-linux-glibc21-i386 ?
- #?./install.sh?
安裝操作: [ok] -> [EXIT] -> [YES] -> [/httpd/zend] -> [/httpd/apache/conf] -> [yes] -> [OK] -> [OK] -> [NO]
遇到的一些錯(cuò)誤解決:
1.php5在configure時(shí)提示:confi
關(guān)鍵詞標(biāo)簽:Mysql,php5,apache,li
相關(guān)閱讀
熱門文章 Xbox Game Pass 10款MySQL數(shù)據(jù)庫(kù)客戶端圖形界面管理工具推薦 MySQL常用維護(hù)管理工具 MySQL數(shù)據(jù)庫(kù)啟動(dòng)失敗1067進(jìn)程意外終止的解決辦法總結(jié)
人氣排行 10款MySQL數(shù)據(jù)庫(kù)客戶端圖形界面管理工具推薦 MySQL數(shù)據(jù)庫(kù)啟動(dòng)失敗1067進(jìn)程意外終止的解決辦法總結(jié) Mysql 1045錯(cuò)誤解決辦法 MySQL服務(wù)器進(jìn)程CPU占用100%解決辦法 MySQL導(dǎo)出導(dǎo)入命令的用例 MySQL連接字符串的實(shí)際操作步驟匯總 MySQL無法啟動(dòng)、無法停止各種解決方法總結(jié) 三種常用的MySQL建表語(yǔ)句