Linux環境下Nginx配置安裝PHP

來源:互聯網
上載者:User

標籤:4.4   bsp   bcmath   libiconv   beauty   pac   src   安裝配置   linux   

下邊的安裝配置方法,我試了一晚上沒有成功,可能因為我的系統內容比較複雜,所以建議:

先安裝PHP。使用yum命令安裝,在安裝配置MySQL,具體做法看部落格中其他文章,至於Nginx伺服器可以安裝完這兩個之後再安裝配置,因為我目前不使用Nginx,直接使用Apache伺服器,所以就沒有在系統上編譯安裝Nginx,目前使用Wordpress,不需要Nginx,只要PHP和Mysql安裝配置好,就可以了;

 

1.下載PHP依賴庫:

wget http://soft.beauty-soft.net/lib/libiconv/libiconv-1.13.1.tar.gz

wget http://soft.beauty-soft.net/lib/mcrypt/libmcrypt-2.5.8.tar.gz

wget http://soft.beauty-soft.net/lib/mcrypt/mcrypt-2.6.8.tar.gz

wget http://soft.beauty-soft.net/lib/mhash/mhash-0.9.9.9.tar.gz

wget http://soft.beauty-soft.net/lib/libiconv/php-5.3.6.tar.gz

 

2.下載後安裝:

tar zxvf libiconv-1.13.1.tar.gz

cd libiconv-1.13.1/

./configure --prefix=/usr/local

make

make install

cd ../

tar zxvf libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8/

./configure

make

make install

/sbin/ldconfig

cd libltdl/

./configure --enable-ltdl-install

make

make install

cd ../../

tar zxvf mhash-0.9.9.9.tar.gz

cd mhash-0.9.9.9/

./configure

make

make install

cd ../

ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la

ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so

ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4

ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8

ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a

ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la

ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so

ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2

ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1

ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config

tar zxvf mcrypt-2.6.8.tar.gz

cd mcrypt-2.6.8/

/sbin/ldconfig

./configure

make

make install

cd ../

 

3.安裝PHP:必須加入php-fpm擴充,還有MySQL資料庫的相應擴充;

tar zxvf php-5.3.6.tar.gz

cd php-5.3.6

./configure  --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc  --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --with-mime-magic --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd

 

4.執行錯誤:configure: error: xml2-config not found. Please check your libxml2 installation.

解決辦法:

5.執行錯誤:configure: error: libjpeg.(a|so) not found.

解決辦法:

 

6.執行錯誤:configure: error: libpng.(a|so) not found.

解決辦法:ln -s /usr/lib64/libpng.so /usr/lib/libpng.so

 

make ZEND_EXTRA_LIBS=‘-liconv‘

7.執行錯誤:make: *** [ext/dom/node.lo] Error 1

解決辦法:在這之前要安裝patch命令到linux中:yum -y install patch

 

8.執行錯誤:make: *** [sapi/cgi/php-cgi] Error 1

解決辦法:

 

make install

Linux環境下Nginx配置安裝PHP

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.