溫馨提示×

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

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

一鍵安裝lamp之php插件

發(fā)布時(shí)間:2020-10-22 23:53:27 來(lái)源:網(wǎng)絡(luò) 閱讀:341 作者:lvnian2009 欄目:web開發(fā)

#!/bin/sh

##一鍵優(yōu)化lamp之php


#安裝eaccelerator緩存加速器

cd /home/lvnian/tools

  tar jxf eaccelerator-0.9.6.tar.bz2 

  cd eaccelerator-0.9.6

  /application/php/bin/phpize 

  ./configure --enable-eaccelerato=shared --with-php-config=/application/php/bin/php-config 

  echo $?

  make && make install

  ls -l  /application/php5.3.27/lib/php/extensions/no-debug-zts-20090626/

  

 ######編譯安裝xcache,xcache和eaccelerator都是加速模塊,在生產(chǎn)中選擇一個(gè)安裝就可以了

cd /home/lvnian/tools

  tar jxf xcache-1.3.2.tar.bz2 

  cd xcache-1.3.2

  /application/php/bin/phpize

  ./configure --enable-xcache --with-php-config=/application/php/bin/php-config 

  echo $?

  make && make install

  ls -l  /application/php5.3.27/lib/php/extensions/no-debug-zts-20090626/

  

###安裝PDO_MYSQL擴(kuò)展插件(可選擇的)

cd /home/lvnian/tools

   tar zxf  PDO_MYSQL-1.0.2.tgz 

   cd PDO_MYSQL-1.0.2

    /application/php/bin/phpize

   ./configure  --with-php-config=/application/php/bin/php-config \

   --with-pdo-mysql=/application/mysql

   echo $?

   make && make install

   ls -l  /application/php5.3.27/lib/php/extensions/no-debug-zts-20090626/

   

###安裝數(shù)據(jù)量Memcache緩存客戶端軟件(客戶端軟件)


   cd /home/lvnian/tools

  tar zxf memcache-2.2.5.tgz 

  cd memcache-2.2.5

  /application/php/bin/phpize

  ./configure  --with-php-config=/application/php/bin/php-config 

  make && make install

  ls -l  /application/php5.3.27/lib/php/extensions/no-debug-zts-20090626/

  

###安裝圖像軟件

yum -y instals -l perl-CPAN

cd /home/lvnian/tools

  tar zxf ImageMagick.tar.gz 

  cd ImageMagick-6.5.1-2/

  ./configure

 make && make install

 

 ##安裝擴(kuò)展插件

cd /home/lvnian/tools

  tar zxf imagick-2.3.0.tgz 

  cd imagick-2.3.0

  /application/php/bin/phpize

   ./configure  --with-php-config=/application/php/bin/php-config 

  make && make install

  ls -l  /application/php5.3.27/lib/php/extensions/no-debug-zts-20090626/


  ##配置php加速和緩存模塊擴(kuò)展

cp /application/php/lib/php.ini /application/php/lib/php.ini.ori

grep ' extension_dir = "./"' /application/php/lib/php.ini

sed -i 's#; extension_dir = "./"#extension_dir = "/application/php/lib/php/extensions/no-debug-zts-20090626/"#g' /application/php/lib/php.ini 

grep 'extension_dir = ' /application/php/lib/php.ini

cat >> /application/php/lib/php.ini <<eof

extension = memcache.so

extension = pdo_mysql.so

extension = imagick.so

eof


##配置eaccelerator 緩存目錄

grep User /application/apache/conf/httpd.conf


mkdir -p /tmp/eaccelerator

chown lvnian.lvnian /tmp/eaccelerator -R


##配置eaccelerator參數(shù)


cat >>/application/php/lib/php.ini<<eof 

[eaccelerator]

extension=eaccelerator.so

eaccelerator.shm_size="128"

eaccelerator.cache_dir="/tmp/eaccelerator"

eaccelerator.enable="1"

eaccelerator.optimizer="1"

eaccelerator.check_mtime="1"

eaccelerator.debug="0"

eaccelerator.filter=""

eaccelerator.shm_max="0"

eaccelerator.shm_ttl="3600"

eaccelerator.shm_prune_period="3600"

eaccelerator.shm_only="0"

eaccelerator.compress="1"

eaccelerator.compress_level="9"

eof


echo "------------php eaccelerator-------------"

/application/php/bin/php -v


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

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

AI