0

I am trying to load apcu with php 7.1 in ubuntu 16.04, i have done the following steps:

sudo apt-get install software-properties-common python-software-properties
sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -s php-apcu
sudo bash -c "echo extension=apcu.so > /opt/plesk/php/7.1/etc/php.d/apcu.ini"
sudo bash -c "echo extension=apc.so > /opt/plesk/php/7.1/etc/php.d/z_apc.ini"
sudo service apache2 restart

the installation was successful but it doesn't load in phpinfo, can anyone help?

mkilmanas
  • 3,395
  • 17
  • 27
eroticid
  • 39
  • 1
  • 1
  • 7
  • I would check if there any of the files from /opt/plesk/php/7.1/etc/php.d/ loaded when viewing phpinfo. That's is not the default path for php config files, so need to verify if this custom path is included at all. Alternatively, create those ini files in /opt/plesk/php/7.1/mods-available and use `phpenmod -v 7.1 -s ALL apcu z_apc` to enable them (it should map to the correct config dirs for you) – mkilmanas May 09 '17 at 14:21
  • When viewing phpinfo i can see it in Additional .ini files parsed, /opt/plesk/php/7.1/etc/php.d/50-xdebug.ini, /opt/plesk/php/7.1/etc/php.d/apcu.ini, in my case mods-available folder is not there but pear.conf php.d php-fpm.conf php-fpm.d php.ini are there – eroticid May 09 '17 at 14:41
  • OK, so paths are correct then as long as they show in Additional .ini files. Could you paste somewhere what your phpinfo shows (don't forget to remove any potentially sensitive data first)? Does `php7.1 -m` show apc/acpu among the loaded modules? – mkilmanas May 09 '17 at 14:57
  • My next suspicion is that it fails to find the .so files. Try running `find / -name apcu.so` and when you get the result, indicate the full path in the ini file. E.g. `extension=apcu.so` becomes `extension=/usr/lib/php/20160303/apcu.so` or something similar. Repeat the procedure for another .so file as well – mkilmanas May 09 '17 at 15:30
  • Yes it is in /usr/lib/php/20131226/apcu.so I have added sudo bash -c "echo extension=/usr/lib/php/20131226/apcu.so > /opt/plesk/php/7.1/etc/php.d/apcu.ini" and sudo bash -c "echo extension=/usr/lib/php/20131226/apcu.so > /opt/plesk/php/7.1/etc/php.ini" but still got the same result – eroticid May 09 '17 at 16:01
  • Hi and welcome to StackOverflow. The question you have posted does not fall in the scope of questions discussed here. Please refer to the [FAQ](http://stackoverflow.com/faq) to see what kind of questions you can ask here. Regards. – Brandon Zamudio May 09 '17 at 19:56
  • how-to-install-the-php-apcu-extension https://serverpilot.io/community/articles/how-to-install-the-php-apcu-extension.html – DevWL Sep 30 '17 at 20:37

1 Answers1

3

Just install plesk-php71-devel, make, gcc on your Plesk server. Then run:

/opt/plesk/php/7.1/bin/pecl install apcu
echo "extension=apcu.so" > /opt/plesk/php/7.1/etc/php.d/apcu.ini
plesk bin php_handler --reread

And you will see loaded acpu module with:

/opt/plesk/php/7.1/bin/php -m | grep apcu
jkucharovic
  • 4,214
  • 1
  • 31
  • 46
IgorG
  • 1,181
  • 6
  • 8