Sunday, February 5, 2012

Installing php 5.2+ Installing eAccelerator+ Installing Zend Optimizer


1. Installing php 5.2

# nano /etc/yum.repos.d/CentOS-Testing.repo
and input these code there:

[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
includepkgs=php*
after installing:
# yum -y install php
That’s all. We have php 5.2 there

2. Installing eAccelerator:


# wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2
# tar fvx eaccelerator-0.9.6.1.tar.bz2
# yum -y install gcc-c++ make php-devel
# cd eaccelerator-0.9.6.1
# phpize
# ./configure && make && make install
# mkdir /var/tmp/eaccelerator
# chmod 777 /var/tmp/eaccelerator
# nano /etc/php.ini
and insert following strings there
[eAccelerator]
eaccelerator.shm_size=”32″
eaccelerator.cache_dir=”/var/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=”1800″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″
eaccelerator.keys = “shm”
eaccelerator.sessions = “shm”
eaccelerator.content = “shm” [Zend]
zend_extension=/usr/lib64/php/modules/eaccelerator.so
Restart apache and check php:
service httpd restart
php -v

3. Installing Zend Optimizer:

# wget http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
# tar fvx ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
Copy directory content of ZendOptimizer-3.3.9-linux-glibc23-x86_64 to /etc/zend
Insert following string into php.ini:
zend_extension=/etc/zend/data/5_2_x_comp/ZendOptimizer.so
That’s all falks. I have:
[root@host ~]# php -v
PHP 5.2.10 (cli) (built: Nov 13 2009 11:44:05)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies

2 comments: