Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seven branch doesn't work with PHP7RC5 #137

Closed
PHPGangsta opened this Issue Oct 23, 2015 · 9 comments

Comments

Projects
None yet
8 participants
@PHPGangsta
Copy link

PHPGangsta commented Oct 23, 2015

Hi Joe,

I'm trying to make apcu work with PHP7RC5, but I'm not able to.

I do the following:

git clone https://github.com/krakjoe/apcu.git --branch seven
cd apcu
/usr/local/php7.0.0RC5/bin/phpize --with-php-config=/usr/local/php7.0.0RC5/bin/php-config
./configure --enable-apcu-bc --with-php-config=/usr/local/php7.0.0RC5/bin/php-config
make
make test

All tests are failing, here the first lines of the output:

$ make test

Build complete.
Don't forget to run 'make test'.

PHP Warning:  PHP Startup: Unable to load dynamic library '/home/mkliewe/Temp/apcu/modules/apc.so' - /home/mkliewe/Temp/apcu/modules/apc.so: undefined symbol: zif_apcu_store in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/home/mkliewe/Temp/apcu/modules/apc.so' - /home/mkliewe/Temp/apcu/modules/apc.so: undefined symbol: zif_apcu_store in Unknown on line 0

=====================================================================
PHP         : /usr/local/php7.0.0RC5/bin/php 
Warning: PHP Startup: Unable to load dynamic library '/home/mkliewe/Temp/apcu/modules/apc.so' - /home/mkliewe/Temp/apcu/modules/apc.so: undefined symbol: zif_apcu_store in Unknown on line 0

PHP_SAPI    : cli
PHP_VERSION : 7.0.0RC5
ZEND_VERSION: 3.0.0-dev
PHP_OS      : Linux - Linux Michael-iMac 3.16.0-50-generic #67~14.04.1-Ubuntu SMP Fri Oct 2 22:07:51 UTC 2015 x86_64
INI actual  : /home/mkliewe/Temp/apcu/tmp-php.ini
More .INIs  :   
CWD         : /home/mkliewe/Temp/apcu
Extra dirs  : 
VALGRIND    : Not used

Nevertheless, in the modules/ folder I find apc.la, apc.so, apcu.la and apcu.so.

Adding the following to my php.ini:

extension=apcu.so
apc.enabled=1
apc.shm_size=256M
apc.ttl=7200
apc.enable_cli=1
apc.gc_ttl=3600
apc.entries_hint=4096
apc.slam_defense=1
apc.serializer=php

/usr/local/php7.0.0RC5/bin/php -m | grep apc
gives "apcu" as output, so it seems to be loaded fine.

Then I test it on the commandline, and I get:
PHP Fatal error: Uncaught Error: Call to undefined function apc_store() in /tmp/testapc.php:3
If I use apcu_store() it's working fine. But I need the old backwards-compatible apc_* functions.

If I switch to load apc.so in php.ini, then I get this:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php7.0.0RC5/lib/php/extensions/no-debug-non-zts-20151012/apc.so' - /usr/local/php7.0.0RC5/lib/php/extensions/no-debug-non-zts-20151012/apc.so: undefined symbol: zif_apcu_store in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library '/usr/local/php7.0.0RC5/lib/php/extensions/no-debug-non-zts-20151012/apc.so' - /usr/local/php7.0.0RC5/lib/php/extensions/no-debug-non-zts-20151012/apc.so: undefined symbol: zif_apcu_store in Unknown on line 0

and "Call to undefined function apc_store()..."

Can you or someone tell me how I can install apcu and get the "old backwards-compatible apc_* functions" ?
If everything that I do is correct, maybe the problem is this "undefined symbol: zif_apcu_store", can someone fix this maybe to make it work?

Many thanks in advance!

@krakjoe

This comment has been minimized.

Copy link
Owner

krakjoe commented Oct 24, 2015

To use the new separate backward compatibility extension, you must load apcu.so first, then apc.so.

extension=apcu.so
extension=apc.so
apc.enabled=1
apc.shm_size=256M
apc.ttl=7200
apc.enable_cli=1
apc.gc_ttl=3600
apc.entries_hint=4096
apc.slam_defense=1
apc.serializer=php

@krakjoe krakjoe closed this Oct 24, 2015

@PHPGangsta

This comment has been minimized.

Copy link
Author

PHPGangsta commented Oct 24, 2015

Thank you very much, if I load both extensions it works!

But I just saw that I had a mistake in half of the config lines, it of cause has to be apc.* and NOT apu.*
Maybe you can change that in your comment, too, so others don't copy&paste these wrong lines...

Thanks for your work and fast help!

@Stricted

This comment has been minimized.

Copy link
Collaborator

Stricted commented Oct 24, 2015

i have edited it for him ;)

@PHPGangsta

This comment has been minimized.

Copy link
Author

PHPGangsta commented Oct 24, 2015

👍

@karimsmartica

This comment has been minimized.

Copy link

karimsmartica commented Jun 5, 2016

Hello @krakjoe
Same problem here.
I edited the php.ini (/etc/php/7.0/fpm/php.ini) and added the following lines at bottom.
extension=apcu.so extension=apc.so apc.enabled=1 apc.shm_size=256M apc.ttl=7200 apc.enable_cli=1 apc.gc_ttl=3600 apc.entries_hint=4096 apc.slam_defense=1 apc.serializer=php

Reloaded Apache

But it's still not working.

`Cannot load Zend OPcache - it was already loaded
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/apc.so' - /usr/lib/php/20151012/apc.so: undefined symbol: zif_apcu_store in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/apc.so' - /usr/lib/php/20151012/apc.so: undefined symbol: zif_apcu_store in Unknown on line 0
Cannot load Zend OPcache - it was already loaded
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/apc.so' - /usr/lib/php/20151012/apc.so: undefined symbol: zif_apcu_store in Unknown on line 0
`

@jirislav

This comment has been minimized.

Copy link

jirislav commented Nov 12, 2017

well, @krakjoe's solution is working for me, but I have:

My concrete Dockerfile solution:

FROM php:7.1-apache-jessie

# Install php modules provided by PECL
RUN pecl install \
        apcu \
        apcu_bc-beta
    
# Enable all installed modules
RUN docker-php-ext-enable \
        apcu

# Manually enable apc (it's beta version)
# https://github.com/krakjoe/apcu/issues/137#issuecomment-150760383
RUN echo "extension=apc.so \n"\
         "apc.enabled=1 \n"\
         "apc.shm_size=256M \n"\
         "apc.ttl=7200 \n"\
         "apc.enable_cli=1 \n"\
         "apc.gc_ttl=3600 \n"\
         "apc.entries_hint=4096 \n"\
         "apc.slam_defense=1 \n"\
         "apc.serializer=php \n" >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini
@davidbqzt

This comment has been minimized.

Copy link

davidbqzt commented Jan 11, 2018

Hi @krakjoe how do you get apc.so on PHP7?

I have 7.0.26 on apache under Centos 7, I've succeded installing apcu, but this does not includes apc.so and I have an app wich is failing because of absence of apc.so

I would really appreciate if someone can guide me to get apc.so

Thanks,

David.

@remicollet

This comment has been minimized.

Copy link
Collaborator

remicollet commented Jan 12, 2018

@Nirjonadda

This comment has been minimized.

Copy link

Nirjonadda commented Jan 12, 2018

@remicollet Do you have any plan apcu_bc stable release?

Issue here: krakjoe/apcu-bc#25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.