Help with apcu

Sahi

Verified User
Joined
Nov 10, 2011
Messages
27
Hi,

i followed a lot of guides to get APCu working om my machine, but nothing seems to be working.

https://www.mysterydata.com/how-to-...-apcu-memcached-and-redis-on-vesta-cp-centos/
gets:

No package php-pecl-apcu available

pecl install --force apcu
gets:

Warning: popen() has been disabled for security reasons in OS/Guess.php on line 241
PHP Warning: popen() has been disabled for security reasons in /usr/local/lib/php/OS/Guess.php on line 241

Warning: fgets() expects parameter 1 to be resource, null given in OS/Guess.php on line 242
PHP Warning: fgets() expects parameter 1 to be resource, null given in /usr/local/lib/php/OS/Guess.php on line 242

Warning: pclose() expects parameter 1 to be resource, null given in OS/Guess.php on line 251
PHP Warning: pclose() expects parameter 1 to be resource, null given in /usr/local/lib/php/OS/Guess.php on line 251
warning: pecl/apcu requires PHP (version >= 7.0.0-dev), installed version is 5.6.40
downloading apcu-5.1.16.tgz ...
Starting to download apcu-5.1.16.tgz (94,032 bytes)
.....................done: 94,032 bytes
38 source files, building
running: phpize

Warning: popen() has been disabled for security reasons in PEAR/Builder.php on line 465
PHP Warning: popen() has been disabled for security reasons in /usr/local/lib/php/PEAR/Builder.php on line 465
ERROR: failed to run `phpize'
 
Warning: popen() has been disabled for security reasons in OS/Guess.php on line 241
and
Warning: popen() has been disabled for security reasons in PEAR/Builder.php on line 465
Looks like the disabling of popen() is causing the main issue.

You could try to enable this again.
Check your php.ini under "disable_functions" if it's mentioned there. If yes, remove it, save te php.ini, restart apache and try again.
 
Hi Richard,

disabled popen()

results in

warning: pecl/apcu requires PHP (version >= 7.0.0-dev), installed version is 5.6.40

and

shtool at '/tmp/pear/temp/apcu/build/shtool' does not exist or is not executable.
 
Hello,

Try


Code:
cd /root
wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/php/php-extension.sh -O php-extension.sh
chmod 750 php-extension.sh
./php-extension.sh install apcu --ver=4.0.11 --php=56
 
Hi Alex,

thanks. That did something.
But my osticket installation still tells me there is no APCu Extension
 
Last edited:
Did you restart apache or php-fpm already?


Code:
cd /root && ./php-extension.sh status apcu

What do you see?
 
restarted ofcourse

This is the result.

[Warning] The extension apcu for PHP 53 not found!
[Warning] The extension apcu for PHP 55 not found!
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/imagick.so' - /usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
[OK] The extension apcu for PHP 56 seems to be enabled!
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/imagick.so' - /usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
apcu
APCu Support => Disabled
APCu Debugging => Disabled

There are errors for imagick. Didn't get that working also, but wanted to focus on APCu first.
I'm running php5.3_mod and php 5.6_fpm
 
To install APCu for other versions of PHP 5.x, run:

Code:
cd /root && ./php-extension.sh install apcu --ver=4.0.11

It will fail for PHP 7+


Then you might need to adjust /usr/local/php*/lib/php.conf.d/90-custom.ini for memory limits of APC(u)
* - replace with 53, 55, 56, according to your PHP version.
 
I made an install for every version now thanks.

But still no luck.

my 90-custom.ini

extension=imagick.so
extension=apcu.so

When i look what my php.ini is with: /usr/local/bin/php --ini | grep 'Loaded Configuration File'

it tells me
/usr/local/lib/php.ini

When i look where the apcu.so is this is the result:

/usr/local/php55/lib/php/extensions/no-debug-non-zts-20121212/apcu.so
/usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/apcu.so
/usr/local/php53/lib/php/extensions/no-debug-non-zts-20090626/apcu.so

So what can be wrong?
 
What do you have there?

Code:
/usr/local/directadmin/custombuild/build options | grep -i php
?

Code:
php -v
?

Code:
php --ini
?
 
/usr/local/directadmin/custombuild/build options | grep -i php

PHP (default): 5.6 as mod_php
PHP (additional): 5.3 as php-fpm
phpMyAdmin: 4.8.5-all-languages
Replace "php.ini" with '/usr/local/directadmin/custombuild/build all' and '/usr/local/directadmin/custombuild/build php_ini': no

php -v
PHP 5.6.40 (cli) (built: Feb 2 2019 19:34:38)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2014, by Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

php --ini
Configuration File (php.ini) Path: /usr/local/lib
Loaded Configuration File: /usr/local/lib/php.ini
Scan for additional .ini files in: /usr/local/lib/php.conf.d
Additional .ini files parsed: /usr/local/lib/php.conf.d/10-directadmin.ini,
/usr/local/lib/php.conf.d/50-webapps.ini

So if i'm right /usr/local/php*/lib/php.conf.d/90-custom.ini is not parsed?
How to fix?
 
copy /usr/local/php56/lib/php.conf.d/90-custom.ini to /usr/local/lib/php.conf.d/90-custom.ini then. And restart apache.
 
Still nothing.

php --ini
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/apcu.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/apcu.so: cannot open shared object file: No such file or directory in Unknown on line 0
Configuration File (php.ini) Path: /usr/local/lib
Loaded Configuration File: /usr/local/lib/php.ini
Scan for additional .ini files in: /usr/local/lib/php.conf.d
Additional .ini files parsed: /usr/local/lib/php.conf.d/10-directadmin.ini,
/usr/local/lib/php.conf.d/50-webapps.ini,
/usr/local/lib/php.conf.d/90-custom.ini

When i look into /usr/local/lib/php/extensions/no-debug-non-zts-20131226/ there is no apcu.so
Can i just copy the file from /usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/apcu.so
 
Thanks for your help Alex,

Maybe you can help mee with ImageMagick too.
Imagick is already working, But Imagemagick is not found.

I can not install php-pear and php-devel
 
Back
Top