One click to optimize the PHP of lamp

Source: Internet
Author: User
Tags imagemagick zts

#!/bin/sh

# #一键优化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 and eaccelerator are all acceleration modules, select one installation in production

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扩展插件 (selectable)

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/

# # #安装数据量Memcache缓存客户端软件 (client software)


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

# #安装扩展插件

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加速和缓存模块扩展

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 Cache Directory

grep user/application/apache/conf/httpd.conf


Mkdir-p/tmp/eaccelerator

Chown Lvnian.lvnian/tmp/eaccelerator-r


# #配置eaccelerator参数


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


This article is from the "Technology Change Destiny" blog, please be sure to keep this source http://lvnian.blog.51cto.com/7155281/1697679

One click to optimize the PHP of lamp

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.