Install PHP5.6 and APC

How to install APC under PHP 5.6?

APC 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 in php.ini

 extension=apc.so 

But APC is not mentioned in phpinfo() output

 Fatal error: Call to undefined function apc_fetch() 
+5
source share
5 answers

APC is a (more or less) obsolete package (the latest version, 3.1.14, was unstable and had to be canceled), It was replaced by the operating package of the main package.

I'm not sure about Debian flavors (all my queries return the PECL library, while opcache is native to 5.6), but on CentOS you need to install the php-opcache package containing the opcahce.so file.

+7
source

It works for me

 yum install php56w-pecl-apcu 
+4
source

For Amazon Linux, the team below worked for me.

yum install php56-pecl-apcu

+3
source

As others have mentioned on this subject, in PHP 5.6 you probably don't need the full APC package. Instead, you will almost certainly need a part for caching user data, APCu.

If you are using PECL, you need to specify the correct version of APCu to use, which is apparently 4.0.11:

 pecl install apcu-4.0.11 

(Worked for me on CentOS 6, EasyApache 3, Apache 2.2, PHP 5.6.39. πŸŽ‰)

0
source

On Ubuntu 18.04, this worked for me:

  1. Download rpm from here

  2. install alien to install rpm

  sudo apt-get install alien 
  1. install apcu
  sudo alien -i ~/Downloads/php56-php-pecl-apcu-4.0.11-1.el7.remi.x86_64.rpm 
  1. open apcu.ini
  sudo nano /etc/php/5.6/cli/conf.d/20-apcu.ini 
  1. add these lines to enable apcu
  extension=apcu.so apc.enabled=1 apc.enable_cli=1 
0
source

Source: https://habr.com/ru/post/1206484/


All Articles