溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

PHP安裝教程

發(fā)布時(shí)間:2020-07-17 12:44:04 來源:網(wǎng)絡(luò) 閱讀:402 作者:wjpingok 欄目:web開發(fā)

安裝php (php-5.1.6.tar.bz2)

        cp php-5.1.6.tar.bz2 /home
        cd /home
        tar jxf php-5.1.6.tar.bz2
        cd php-5.1.6
        ./configure --with-apxs2=/usr/local/apache/bin/apxs --disable-debug --enable-safe-mode --enable-trans-sid --with-xml --with-mysql --enable-short-tags --with-gd --with-zlib --with-jpeg --with-png --enable-memory-limit --disable-posix --with-config-file-path=/usr/local/lib 

1、解決configure: error: libpng.(a|so) not found.

# ln -s /usr/lib64/libjpeg.so /usr/lib/# ln -s /usr/lib64/libpng.so /usr/lib/
2、錯(cuò)誤說明

centos64位版本上安裝PHP時(shí)在./configure 步驟的時(shí)候出現(xiàn)了下面錯(cuò)誤
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!

原因分析與解決

通過查找libmysqlclient,發(fā)現(xiàn)是在/usr/lib64/mysql/目錄內(nèi)的libmysqlclient.so.15.0.0做的軟連接,PHP默認(rèn)是去的/usr/lib/搜索,所以沒有找到.
解決辦法就是:
cp /usr/lib64/mysql/* /usr/lib/mysql/
然后進(jìn)行./configure即可,如果服務(wù)器沒有/usr/lib/mysql/ 目錄,則在/usr/lib/目錄下創(chuàng)建mysql目錄即可



        說明:
         --with-apxs2=/usr/local/apache/bin/apxs \  這是加入apache中為DSO模塊的位置
         --disable-debug \ #關(guān)閉php內(nèi)部調(diào)試 
         --enable-safe-mode \ #打開php的安全模式 
         --enable-trans-sid \ 
         --with-xml \ #支持xml 
         --with-mysql \ #支持mysql 
         --enable-short-tags \ #支持PHP的短標(biāo)記 
         --with-gd \ #支持GD庫 
         --with-zlib \ #支持zlib 
         --with-jpeg \ 
         --with-png \ 
         --enable-memory-limit \ 
         --disable-posix \ 
         --with-config-file-path=/usr/local/lib 
        總之復(fù)制粘貼就可以了,-_-
        make
        make install
        cp php.ini-dist /usr/local/lib/php/php.ini 復(fù)制php的配置文件
        cd /usr/local/lib/php/
        vi php.ini  修改配置文件
                  register_globals = On   一般在399行
                保存退出


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

php
AI