How to install eAccelerator in PHP 5.3 under CentOS 6
Dec 12, 2014 under Linux Server
Current testing system:
Here is the issue: once you install eaccelerator (RPM from EPEL, see CentOS Repository with command: yum install php-eaccelerator) and phpMyAdmin 22.214.171.124 (also from RPM), you notice a big issue. Some other complained too, including official reported bug.
Php will start crashing running phpMyAdmin and in apache error logs ( /var/log/httpd/* ..) you will notice:
[notice] child pid NUMBER exit signal Segmentation fault (11)
Some are telling you to remove eaccelerator, but is completelly bad. You definivelly need some php accelerator. We tested APC (RPM using yum install php-pecl-apc ) but we noticed a strange behavior, so was looking unreliable.
Others tried to upgrade PHP to 5.4 on CentOS 6.x, however, there are many other issues to consider for your application to upgrade.
So, the solution is simple. Re-install eaccelerator from source. Bellow is what i’ve done as user root (# means comment line)
yum remove php-eaccelerator
tar -zxvf master
cd DIRECTORY #where eaccelerator-eaccelerator is unzipped
phpize # do "yum install php-devel" in case you don't have'it installed
make # do yum install make if you get "bash: make: command not found"
vim /etc/php.d/eaccelerator.ini #add the content from generated eaccelerator.ini
chmod 0777 /tmp/eaccelerator
#in case you get PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/eaccelerator.so
locate eaccelerator.so #and check the location.
mv DIRECTORY/eaccelerator-eaccelerator-42067ac/modules/eaccelerator.so /usr/lib64/php/modules/eaccelerator.so
PHP 5.3.3 (cli) (built: Jul 12 2013 20:35:47)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with eAccelerator v1.0-dev, Copyright (c) 2004-2012 eAccelerator, by eAccelerator
rm master -rf
rm eaccelerator-eaccelerator-42067ac -rf
If you need some other fancy stuff like eAccelerator Control Panel, see How to Set Up PHP eAccelerator on CentOS & RHEL
Additionally, you can check the installation from source for eaccelerator directly from project repository.