Установка eAccelerator (замена Turck MMCache)
HOW-TO: Install Eaccelerator (Turck MMCache replacement)
--------------------------------------------------------------------------------
Updated to Eaccelerator 0.9.2a
Eaccelerator is a further development from mmcache PHP Accelerator & Encoder. It increases performance of PHP scripts by caching them in compiled state, so that the overhead of compiling is almost completely eliminated.
The instructions in this How-To is a bit different to the official one, because the directories are a bit different - I couldn't get this to work using the instructions from the official guide itself. I also point to the module file in a different directory in php.ini - the default one in the official instructions didn't work for me.
NOTE: I couldn't get mmcache to work with PHP 4.3.11 as well. eaccelerator works.
Follow the instructions to install or to upgrade from mmcache.
Installation:
Upgrade instructions are the same as installation. Note the lines in red which are different to previous instructions.
NOTE: Each time you upgrade PHP, you need to COMPLETELY REINSTALL eaccelerator BY DELETING THE WHOLE eaccelerator DIRECTORY, AND UNTARRING A NEW eaccelerator DIRECTORY!
1) Login as root in SSH
2) Run the following commands in the following order:
cd /
mkdir ea
cd ea
wget http://optusnet.dl.sourceforge.net/eaccelerator-0.9.2a.tar.gz
tar xvzf eaccelerator-0.9.2a.tar.gz
cd eaccelerator
export PHP_PREFIX="/usr"
$PHP_PREFIX/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install
3) Edit php.ini - usually it's /etc/php.ini or /usr/local/lib/php.ini
Find this:
;Windows Extensions
Above this, comment out or remove the PHPA or mmcache lines if you have them. Replace them with this:
To install as a ZEND extension:
zend_extension="/ea/eaccelerator/modules/eaccelerator.so"
eaccelerator.shm_size="16"
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="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
OR to install as a PHP extension:
extension="/ea/eaccelerator/modules/eaccelerator.so"
eaccelerator.shm_size="16"
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="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
4) Create the cache directory by doing the following at the command line
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
5) Restart Apache
service httpd restart
Done!
6) Optional - upload ea.php file
I modified the eaccelerator.php file so that only you can control the eaccelerator config and see the stats.
Edit ea.php - change 1 to your userid.
Upload to your forum directory.
When you link to ea.php you can see your eaccelerator stats like this:
eAccelerator 0.9.2
eAccelerator support enabled
Caching Enabled true
Optimizer Enabled true
Memory Size 33,554,396 Bytes
Memory Available 22,675,372 Bytes
Memory Allocated 10,879,024 Bytes
Cached Scripts 101
Removed Scripts 0
Cached Keys 0
HOW-TO: Install Eaccelerator (Turck MMCache replacement)
--------------------------------------------------------------------------------
Updated to Eaccelerator 0.9.2a
Eaccelerator is a further development from mmcache PHP Accelerator & Encoder. It increases performance of PHP scripts by caching them in compiled state, so that the overhead of compiling is almost completely eliminated.
The instructions in this How-To is a bit different to the official one, because the directories are a bit different - I couldn't get this to work using the instructions from the official guide itself. I also point to the module file in a different directory in php.ini - the default one in the official instructions didn't work for me.
NOTE: I couldn't get mmcache to work with PHP 4.3.11 as well. eaccelerator works.
Follow the instructions to install or to upgrade from mmcache.
Installation:
Upgrade instructions are the same as installation. Note the lines in red which are different to previous instructions.
NOTE: Each time you upgrade PHP, you need to COMPLETELY REINSTALL eaccelerator BY DELETING THE WHOLE eaccelerator DIRECTORY, AND UNTARRING A NEW eaccelerator DIRECTORY!
1) Login as root in SSH
2) Run the following commands in the following order:
cd /
mkdir ea
cd ea
wget http://optusnet.dl.sourceforge.net/eaccelerator-0.9.2a.tar.gz
tar xvzf eaccelerator-0.9.2a.tar.gz
cd eaccelerator
export PHP_PREFIX="/usr"
$PHP_PREFIX/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install
3) Edit php.ini - usually it's /etc/php.ini or /usr/local/lib/php.ini
Find this:
;Windows Extensions
Above this, comment out or remove the PHPA or mmcache lines if you have them. Replace them with this:
To install as a ZEND extension:
zend_extension="/ea/eaccelerator/modules/eaccelerator.so"
eaccelerator.shm_size="16"
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="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
OR to install as a PHP extension:
extension="/ea/eaccelerator/modules/eaccelerator.so"
eaccelerator.shm_size="16"
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="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
4) Create the cache directory by doing the following at the command line
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
5) Restart Apache
service httpd restart
Done!
6) Optional - upload ea.php file
I modified the eaccelerator.php file so that only you can control the eaccelerator config and see the stats.
Edit ea.php - change 1 to your userid.
Upload to your forum directory.
When you link to ea.php you can see your eaccelerator stats like this:
eAccelerator 0.9.2
eAccelerator support enabled
Caching Enabled true
Optimizer Enabled true
Memory Size 33,554,396 Bytes
Memory Available 22,675,372 Bytes
Memory Allocated 10,879,024 Bytes
Cached Scripts 101
Removed Scripts 0
Cached Keys 0