php5.3安裝

來源:互聯網
上載者:User
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install autoconf
sudo apt-get install libxml2
sudo apt-get install libxml2-dev
sudo apt-get install libevent-1.4-2
sudo apt-get install libevent-dev
sudo apt-get install bzip2
sudo apt-get install libbz2-dev
sudo apt-get install libcurl3-gnutls
sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install libpng12-0
sudo apt-get install libpng12-dev
sudo apt-get install libjpeg62
sudo apt-get install libjpeg62-dev
sudo apt-get install libfreetype6
sudo apt-get install libfreetype6-dev
sudo apt-get install libmcrypt4
sudo apt-get install libmcrypt-devsudo apt-get install zlib1g-dev

sudo apt-get install libtidy-dev 

 

注意:

如果是RH,需要:

yum -y install curl-devel

yum install libjpeg-develyum install libpng-devel

yum install freetype-devel

yum install -y libmcrypt-devel.x86_64 

 

yum install -y libxml2-devel.x86_64yum install -y bzip2-devel.x86_64 

 

yum install libtool-ltdl-devel (在 make的時候會出現:/usr/bin/ld: cannot find -lltdl)yum install autoconf yum install -y libtidy-devel.x86_64

 

 

編譯、安裝

./configure  --prefix=/usr/local/php-5.3.3 --with-gettext --with-mysql=mysqlnd --with-gd --with-jpeg-dir --with-png-dir --with-curl --with-freetype-dir --enable-gd-native-ttf --enable-mbstring --enable-sockets --with-mcrypt --with-pdo-mysql=mysqlnd --enable-fpm --with-zlib --enable-zip --with-bz2 --enable-bcmath --with-tidy
 make
 make install

編譯安裝完成之後,還需要對php-fpm 進行配置,因為php5.3不再需要打php-fpm補丁,所以以前控制php-fpm(啟動、重啟)的方式需要改變。操作步驟如下:

從源碼包複製:

sudo path/to/php-source/folder/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

sudo chmod a+x /etx/init.d/php-fpm

然後就可以通過 /etc/init.d/php-fpm (start|stop|force-quit|restart|reload) 進行控制

一般擴充安裝

memcached:

 

wget http://pecl.php.net/get/memcache-2.2.5.tgz
tar -xvf memcache-2.2.5.tgz
cd memcache-2.2.5
/usr/local/php-5.3.3/bin/phpize
./configure --with-php-config=/usr/local/php-5.3.3/bin/php-config
make
make install

 

 

 solr

wget http://pecl.php.net/get/solr-0.9.11.tgz
tar -xvf solr-0.9.11.tgz
cd solr-0.9.11
/usr/local/php-5.3.3/bin/phpize
./configure --with-php-config=/usr/local/php-5.3.3/bin/php-config
make
make install

 

xcache

1 wget http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.bz2
2 tar -xjvf xcache-1.3.0.tar.bz2
3 cd xcache-1.3.0
4 /usr/local/php-5.3.3/bin/phpize
5 ./configure --with-php-config=/usr/local/php-5.3.3/bin/php-config
6 make
7 make install

 php_ini

expose_php = off
error_reporting = E_ALL
display_errors = On
short_open_tag = On
 
extension=memcache.so
extension=xcache.so
extension=solr.so bbs需要
 
;log_errors = on
error_log = syslog linux系統可以使用這個,把errorlog 輸出到syslog中
date.timezone = Asia/Shanghai

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.