lanp(linux+apache+gd庫+php)的安裝

ps1:在源碼安裝時(shí),如果配置通過(./configure),但是make(生成makefile失?。藭r(shí)可以用make clean命令清除編譯的結(jié)果,從新進(jìn)行編譯

成都創(chuàng)新互聯(lián)專注于江陽網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠為您提供江陽營銷型網(wǎng)站建設(shè),江陽網(wǎng)站制作、江陽網(wǎng)頁設(shè)計(jì)、江陽網(wǎng)站官網(wǎng)定制、小程序開發(fā)服務(wù),打造江陽網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供江陽網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。

ps2.安裝PHP常見錯(cuò)誤解決error: libjpeg.(a|so),error:libpng.(a|so) not found,error: Cannot find ldap

我都安裝了的,為什么就找不到呢?找不到其實(shí)就應(yīng)試想到它的搜索位置里面是沒有的,要不然才不會(huì)說not found

 [root@GFS_Server php-5.2.13]# rpm -qa | grepjpeg
libjpeg-6b-33
libjpeg-6b-33

 32位和64位的都裝了。你可以強(qiáng)制刪除兩個(gè)包,再重裝64位的包。rpm --allmatches --nodeps這種方法真是損系統(tǒng)又損你.有時(shí)候強(qiáng)制執(zhí)行的東西也會(huì)隨便把lib中的一些包給強(qiáng)制刪了..所以我認(rèn)為不建議這么做,重復(fù)就讓它重復(fù)吧,沒關(guān)系的!

[root@GFS_Serverphp-5.2.13]#locate libjpeg.so
[root@GFS_Server php-5.2.13]# locate libjpeg.a
如果是源碼安裝的,你肯定要添加--with-jpeg-dir=/usr/local/jpeg6,那么在./configure時(shí),會(huì)去這個(gè)目錄下的lib/下尋找libjpeg.so/libjpeg.a文件。此時(shí)肯定這個(gè)目錄下沒有這文件?。。?/p>

另外:(a|so)這些結(jié)尾的都是相應(yīng)包的庫文件

如果沒有指定jpeg的目錄,./configure會(huì)自動(dòng)的去/usr/lib下尋找,這些庫文件。但是實(shí)際上在安裝的時(shí)候(rpm),系統(tǒng)會(huì)默認(rèn)的將這些庫文件放在/usr/lib64下(64位的系統(tǒng)--32位的系統(tǒng)不會(huì)出現(xiàn)這個(gè)問題)

解決:cp -frp /usr/lib64/libpng*   /usr/lib/

==================================LADP安裝=====================
總共11個(gè)源碼包
autoconf-2.61.tar.gz
httpd-2.2.8.tar.gz
libxml2-2.6.19.tar.gz
MySQL-5.0....
freetype-2.1.10.tar.gz
jpegsrc.v6b.tar.gz
libpng-1.2.24.tar.gz
zlib-1.2.3.tar.gz
gd-2.0.35.tar.gz
php-5.2.5.tar.gz


檢查環(huán)境是否安裝gcc
# gcc -v

安裝GD庫==============================
安裝前應(yīng)先依次安裝zlib/libpng/freetype/jpegsrc.v6b/autoconf/gd

===============================================================================

安裝zlib
tar xzvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=/usr/local/zlib
make
make install

ps:64位的linux系統(tǒng)用./configure生成的makefile編譯,雖然不會(huì)出錯(cuò),但是在之后安裝php是肯定會(huì)報(bào)錯(cuò)(/usr/bin/ld:/usr/local/lib/libbz2.a: relocation R_X86_64_32 against `a local symbol' cannot be used when making a shared object; recompile with -fPIC)------------解決方案:vi Makefile
在CFLAGS上加入 -fPIC
CFLAGS = -fPIC  xxxxxxxxxxxxxxxxxx
make && make install && makeclean

此時(shí)問題解決

===============================================================================

安裝libpng
tar xzvf libpng-1.2.24.tar.gz
cd libpng-1.2.24
cp scripts/makefile.linux makefile
make
make install

==========================================================================

安裝freetype TTF包
tar xzvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
./configure --prefix=/usr/local/freetype
make
make install

=========================================================================

安裝jpeg6
tar xzvf jpegsrc.v6b.tar.gz
cd jpeg-6b
mkdir -p /usr/local/jpeg6
mkdir -p /usr/local/jpeg6/bin
mkdir -p /usr/local/jpeg6/lib
mkdir -p /usr/local/jpeg6/include
mkdir -p /usr/local/jpeg6/man
mkdir -p /usr/local/jpeg6/jpeg6man1
mkdir -p /usr/local/jpeg6/man/man1
./configure --prefix=/usr/local/jpeg6--enable-share --enable-static
make
make install
最后安裝jpeg6庫文件
make install-lib
使用libtool完成庫的安裝
libtool --finish /usr/local/jpeg6//lib /

注:在源碼安裝jpeg6時(shí)報(bào)錯(cuò):
make: ./libtool: Command not found 
make: *** [jcapimin.lo] Error 127
錯(cuò)誤分析:由于libtool版本過低導(dǎo)致的,重新下載新版本的libtool以默認(rèn)方式安裝,(一般都是64位的系統(tǒng)上面報(bào)錯(cuò))
1,x64bit的服務(wù)器就是報(bào)這個(gè)錯(cuò)誤,可以直接執(zhí)行:
cp /usr/share/libtool/config.sub . 
cp /usr/share/libtool/config.guess .
而不需另行安裝(必須要從新編譯)
2,x64bit的系統(tǒng)安裝jpeg時(shí)
./configure --prefix=/usr/local/jpeg6 --enable-share --enable-static
make
make install

64位的系統(tǒng)就不用添加以下兩個(gè)步驟了,不然在安裝gd時(shí)是報(bào)錯(cuò)?。。?/p>

---make install-lib
---libtool --finish /usr/local/jpeg6//lib /

===============================================================================

安裝autoconf
tar xzvf autoconf-2.61.tar.gz
cd autoconf-2.61
./configure --prefix=/usr
make
make install

==============================================================================

安裝GD
tar xzvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure --prefix=/usr/local/gd--with-jpeg=/usr/local/jpeg6 --with-png=/usr/local/lib--with-zlib=/usr/local/zlib --with-freetype=/usr/local/freetype
make
make install
cp gd.h /usr/local/lib #將生成的頭文件拷貝到lib目錄下,否則會(huì)出

===============================================================================

安裝freetds(用來連接MS SQLServer和Sybase數(shù)據(jù)庫更具需要是否安裝)
tar xzvf freetds-0.82.tar.gz
cd freetds-0.82
./configure --prefix=/usr/local/freetds--with-tdsver=8.0
make
make install

===============================================================================

安裝mysql===見另外文章==================================

==============================================================================安裝apache

./configure--prefix=/usr/local/apache2 --enable-so --enable-ssl=static--with-ssl=/usr/local/ssl --with-z-dir=/usr/local/zlib

make

make install

設(shè)置apache 自啟動(dòng)
echo "/usr/local/apache2/bin/apachectlstart">>/etc/rc.d/rc.local
檢查是否加入自啟動(dòng)了
cat /etc/rc.d/rc.local

ps:在配置的時(shí)候報(bào)錯(cuò):configure: error: ...No recognized SSL/TLS toolkit detected

解決:安裝openssl-devel

===============================================================================

安裝PHP
PHP 對(duì)XML的支持是建立在libxml2庫的基礎(chǔ)上的

安裝php之前先安裝libxml2
tar -zxvf libxml2-2.6.19.tar.gz
cd libxml2-2.6.19

./configure --prefix=/usr/local/libxml2 --with-zlib=/usr/local/zlib/
make
make install

復(fù)制配置文件
cp xml2-config /usr/bin

===============================================================================

說明:

php必要的選項(xiàng):
--prefix=/usr/local/php
--with-apxs2=/usr/local/apache/bin/apxs
--with-mysql=/usr/local/mysql/
--with-libxml-dir
--enable-mbstring

這是讓PHP支持GD庫的配置選項(xiàng):
--with-gd=/usr/local/gd2/
--with-jpeg-dir=/usr/local/jpeg6/
--with-png
--with-zlib-dir=/usr/lib
--with-freetype-dir=/usr/local/freetype

===============================================================================

接著安裝php
檢查系統(tǒng)是否已經(jīng)安裝php,如果安裝將其卸載
將多個(gè)相關(guān)軟件包一次性卸載:
for i in 'rpm -qa | grep -i php'
>do rpm -e $i --nodeps
>done

tar-zxvf php-5.2.5.tar.gz
cd php-5.2.5
mkdir -p /usr/local/php5
./configure --prefix=/usr/local/php5--with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql          --with-libxml-dir=/usr/local/libxml2--with-png-dir=/usr/local/lib          --with-jpeg-dir=/usr/local/jpeg6--with-zlib-dir=/usr/local/zlib        --with-freetype-dir=/usr/local/freetype--with-gd=/usr/local/gd -    -enable-soap    --enable-mbstring=all

make
make test
make install

建立php配置文件
cp php.ini-dist /usr/local/php5/lib/php.ini
修改apache配置文件添加php支持
vi /usr/local/apache2/conf/httpd.conf
加入(注意之前加過了就不用再加,否則apache不能啟動(dòng):
LoadModule php5_module modules/libphp5.so在此下面加入以下
AddType application/x-httpd-php .php   -

當(dāng)前題目:lanp(linux+apache+gd庫+php)的安裝
當(dāng)前地址:http://bm7419.com/article44/pcosee.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)、定制網(wǎng)站、網(wǎng)站制作、Google、微信公眾號(hào)、企業(yè)網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都app開發(fā)公司