Skip to content

How to get APCu on PHP 7? #5956

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

Closed
nazar-pc opened this issue Apr 26, 2016 · 4 comments
Closed

How to get APCu on PHP 7? #5956

nazar-pc opened this issue Apr 26, 2016 · 4 comments

Comments

@nazar-pc
Copy link

Here is sample build: https://travis-ci.org/nazar-pc/CleverStyle-CMS/builds/125947543
Config:

...
before_script:
  - mysql -e 'CREATE DATABASE `cscms.travis`;'
  - if [[ "$(php -v | grep 'PHP 5')" ]]; then echo yes | pecl install apcu-4.0.8; fi
  - if [[ "$(php -v | grep 'PHP 7')" ]]; then echo yes | pecl install apcu; fi
  - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
...

APCu in PHP 5.6 works fine, in PHP 7 doesn't.

But if I add:

  - if [[ "$(php -v | grep 'PHP 7')" ]]; then echo 'extension = apcu.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi

Immediately I'm getting errors: https://travis-ci.org/nazar-pc/CleverStyle-CMS/jobs/125948629

There definitely is something wrong with PHP 7 setup, can't have APCu there, even though manual insertion extension = apcu.so worked in past.

@BanzaiMan
Copy link
Contributor

https://travis-ci.org/nazar-pc/CleverStyle-CMS/jobs/125948629#L294

http://php.net/manual/en/apcu.installation.php says APCu does not work with PHP 7.

Use apc.so instead. Which should be available.

@nazar-pc
Copy link
Author

  1. No, apc.so is not available, also see apc.so file not found #5618
  2. APCu does work with PHP 7; it worked for months as beta and now it is even considered stable and I have it installed on Ubuntu 16.04 using PECL, see https://pecl.php.net/package/APCu

@BanzaiMan
Copy link
Contributor

Something is referring to a nonexistent header. See the line on the log I indicated above. php_smart_striing.h exists, though.

@nazar-pc
Copy link
Author

Sorry for confusion...
PECL is stupid enough to be unable to install correct version.
PHP 7-compatible version 5.x was the latest stable for some time and 4.x was not updated for some time, but now there is a new release of APCu 4.x and it is picked even by PHP 7 installations for whatever reason as latest, but fails to install... When specified specific version it works fine: https://travis-ci.org/nazar-pc/CleverStyle-CMS/builds/125953085

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

2 participants