PHP5.6 and APC installation
Solution 1
APC is (more or less) a deprecated package (the last release, 3.1.14, was unstable and had to be rolled back). It has been replaced by the core package opcache.
I'm not sure about Debian flavors (all my searches return the PECL library while opcache is native to 5.6) but in CentOS you have to install the php-opcache
package, which contains the opcahce.so file.
Solution 2
It works for me
yum install php56w-pecl-apcu
Solution 3
For Amazon Linux, The below command worked for me.
yum install php56-pecl-apcu
Solution 4
As mentioned by others on this question, on PHP 5.6, you probably don't want the full APC package. Instead, you almost certainly just want the user-data caching portion, APCu.
If you're using PECL, you need to specify the correct version of APCu to use which appears to be 4.0.11:
pecl install apcu-4.0.11
(Worked for me on CentOS 6, EasyApache 3, Apache 2.2, PHP 5.6.39. 🎉)
Solution 5
On Ubuntu 18.04 simply running
sudo apt install php-apcu
and enabling it on /etc/php/5.6/apache2/php.ini
by adding this lines at the end of the file:
extension=apcu.so
apc.enabled=1
(and restarting apache2 if necessary)
sudo service apache2 restart
Worked for me.
clarkk
https://dynaccount.dk https://dynaccount.dk/bogfoeringsprogram/ https://dynaccount.dk/regnskabsprogram/
Updated on April 06, 2020Comments
-
clarkk about 4 years
How to install APC under PHP 5.6?
APC is installed
apt-get install php-pear php5-dev make libpcre3-dev pecl install apc # locate apc.so /usr/lib/php5/20100525/apc.so
APC is added to php.ini
extension=apc.so
But APC is not mentioned in output from
phpinfo()
Fatal error: Call to undefined function apc_fetch()