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

Installing PHP Pecl "apcu_bc" #24

Closed
Nirjonadda opened this issue Sep 22, 2017 · 5 comments
Closed

Installing PHP Pecl "apcu_bc" #24

Nirjonadda opened this issue Sep 22, 2017 · 5 comments

Comments

@Nirjonadda
Copy link

Please let me know that when goes apcu_bc state "stable"? Can not install beta version.

Failed to download pecl/apcu_bc within preferred state "stable", latest release is version 1.0.3, stability "beta", use "channel://pecl.php.net/apcu_bc-1.0.3" to install install failed
@remicollet
Copy link
Collaborator

Just use pecl instal apcu_bc-beta

@Nirjonadda
Copy link
Author

Nirjonadda commented Sep 22, 2017

@remicollet So its are not goes to apcu_bc stable version?

Not work this the following commands. I am using cPanel CENTOS 7.4

# pecl instal apcu_bc-beta
-bash: pecl: command not found

@fireproofsocks
Copy link

@Nirjonadda there was a typo in the command -- should be "install", e.g.

pecl install apcu_bc-beta

However, this still doesn't seem to get the --enable-apcu-bc option working.

php -m | grep apcu

this DOES show apcu installed, but the following script fails:

<?php
if (function_exists('apc_fetch')) {
    print 'bc works';
}

@fireproofsocks
Copy link

fireproofsocks commented Oct 30, 2017

Ok, I think I've figured this out. It would be hugely helpful if this were added to the README (or if there were a CONTRIBUTING file, users could submit their own updates to the docs). It's not very clear how to get this working on PHP 7 to support legacy apps that rely on the various apc_* functions. PHP.net refers to a different compilation flag than what is required here (but you have to look at the source to see that).

Installing APCu with Backwards compatibility mode

Install using pecl

pecl install apcu_bc-beta
# Or in Dockerfile, to get past the prompt, you can do something like:
printf '' | pecl install apcu_bc-beta
# add the .so to your ini file (adjust for your system's paths):
echo "extension=apcu.so" > /etc/php/7.1/cli/conf.d/apcu.ini

Manual install/build using Git

cd /tmp
git clone https://github.com/krakjoe/apcu-bc
cd apcu-bc
phpize
./configure --enable-apc \
make
make install
# add the .so to your ini file (adjust for your system's paths):
echo "extension=apcu.so" > /etc/php/7.1/cli/conf.d/apcu.ini

Usage

Now you should have functions like apcu_fetch() which should be able to replace the legacy apc_fetch() alternatives.

@remicollet
Copy link
Collaborator

Closing as duplicate of #25
About README file, feel free to open a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants