Skip to main content

Install and configure eAccelerator on php 5.3-5.4

Important: Development of the eaccelerator is discontinued. Instead, use opcache inline caching.

The first step to take is to install the php5-dev and make packages if they are missing.

  # aptitude install php5-dev make re2c checkinstall 

Download the accelerator archive.

  # wget 

Unpack the archive.

  # unzip 

And go to the eaccelerator-master folder for compilation.

  # cd eaccelerator-master 

Compile ...

  # phpize 

Configuring ...

  # ./configure 

We assemble and install.

  # checkinstall 

On the question of creating documentation in the console, we write n. In the description of the package, you can specify "eaccelerator".

Create a folder for the cache.

  # mkdir / var / cache / eaccelerator; chmod 0777 / var / cache / eaccelerator 

Create an eaccelerator.ini file in the /etc/php5/conf.d/ folder. It stores configuration files for various php add-ons.

  # nano /etc/php5/conf.d/eaccelerator.ini 

We print the following in this file:

  extension = ""
 eaccelerator.shm_size = "0"
 eaccelerator.cache_dir = "/ var / cache / 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" 

Save the file by pressing ctrl + o (write) and ctrl + x (close) first.

Description of parameters

eaccelerator.shm_size - this setting allows you to control the amount of allocated memory for caching php-script. Installed in megabytes. Setting this value to 0 allows using the default memory size for the OS. To find out this limit, type the command cat / proc / sys / kernel / shmmax in the console .

To measure the maximum size of shmmax, you need to set the parameter kernel.shmmax = value in the file /etc/sysctl.conf, where value should be replaced with the amount of memory you need in megabytes. Then restart the server.

eaccelerator.cache_dir is the folder on the server that will be used to host the eAccelerator cache. The best option is / var / cache / eaccelerator. Create a folder and make sure that the web server has rights to write to this directory.

Description of all parameters (eng).

For phpmyadmin in /etc/apache2/apache2.conf we add this:

  <Directory / usr / share / phpmyadmin>
 php_admin_value eaccelerator.enable 0
 </ Directory> 

Restart apache with the command

  # service apache2 restart 

If your php works in php-fpm mode, then you need to reload it:

  # service php5-fpm restart 

How do you rate the article?
Звёзд: 1Звёзд: 2Звёзд: 3Звёзд: 4Звёзд: 5 (No ratings yet)

Add a comment

Your email will not be published.