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

APCu missing from [email protected] - used to be as easy as brew install php72-apcu #26170

Closed
inoas opened this issue Apr 4, 2018 · 11 comments
Labels
outdated PR was locked due to age

Comments

@inoas
Copy link

inoas commented Apr 4, 2018

php72-apcu is deprecated and I don't see any replacement in here: https://github.com/Homebrew/homebrew-core/blob/master/Formula/php.rb - For PHP 7.x see https://pecl.php.net/package/apcu_bc as described here https://secure.php.net/manual/en/apcu.installation.php

APCu is for instance being used - mich like memcached - to store data - afaik - in all shared php-fpm instances. For instance CakePHP 3 (and most likely 4) does/will support APCu out of the box even in PHP 7.x installations: https://book.cakephp.org/3.0/en/core-libraries/caching.html

@SMillerDev
Copy link
Member

With the migration to Homebrew-core the php formula has stopped taking over the role of PECL. Installing APCu can (and should) be done through PECL (https://pecl.php.net/package/apcu_bc) as you noticed.

@inoas
Copy link
Author

inoas commented Apr 4, 2018

We will not accept versioned formulae such as php71-mcrypt but any of those listed on https://brew.sh/analytics/install/ will be accepted as part of the default, core or versioned php formulae as resources.
We will accept additional application (not library) formulae (such as composer) listed here: https://brew.sh/analytics/install/

Source: https://github.com/Homebrew/homebrew-php/issues/4721

It is sad that homebrew updates broke ways to setup working dev boxes without any more fiddling (such as pecl)

@Blackskyliner
Copy link

Well it's in fact easier to not maintain a already maintained package manager like pecl and or pear. In fact its better that way, as the most problems I had with the old setup was for example an update of a depending library within homebrew. suddenly everything went mayham and nothing worked until it got updated. I guess now that this php packages are within the core repository that will not happen as depending packages are most likely be faster updated from now on. At least this would be a premise I could live with if thats some kind of the intent to merge the sattelites together.

Problem here is also the decreasing count of maintainers of the homebrew project itself. It is just sensible to deliver stable packages instead of having a whole workday of "Oh I did brew upgrade and now php does not work anymore because libicu updated. Lets use version switching.. Ohh I guess I have an semi-automated upgrade process which brew cleans... well no PHP devving for today... Lets google how to downgrade brew to a state where I can pull the old version..." -- And thats not a fictive story either...

@ilovezfs
Copy link
Contributor

ilovezfs commented Apr 5, 2018

@Blackskyliner yes, this should be a pretty significant improvement in usability because brew upgrade will no longer break php* when there are changes in its dependencies.

@ilovezfs ilovezfs closed this as completed Apr 5, 2018
@inoas
Copy link
Author

inoas commented Apr 5, 2018

@ilovezfs so can you explain the note in https://github.com/Homebrew/homebrew-php/issues/4721 - should php-apcu be PRed against homebrew-core or not?

@SMillerDev
Copy link
Member

If you can make the case that it should be installed by default for every new PHP install you can make a PR to add it to the php formula.

@inoas
Copy link
Author

inoas commented Apr 5, 2018

So homebrew-core php formular brings pecl support: https://github.com/Homebrew/homebrew-core/blob/master/Formula/php.rb#L213

Should be as easy as:

brew install php;
pecl channel-update pecl.php.net;
pecl install apcu;

But first time around I got errors, I had to uninstall brew php and reinstall it then pecl.

@inoas
Copy link
Author

inoas commented Apr 5, 2018

SMillerDev it is still a very good choice for fpm-based data caching AFAIR:
Supported by CakePHP, Symfony, Drupal, Wordpress, MediaWiki: https://stackoverflow.com/a/27215230

@inoas
Copy link
Author

inoas commented Apr 5, 2018

So I tried another machine and ran into problems. This should be good:

brew update; # updates local brew meta data
brew untap homebrew/php; # removes old homebrew php tab, now php is in homebrew core
brew list | grep 'php'; # check for all php related installs
brew uninstall php72-apcu; # If you had that previously, also remove all the other libs
brew uninstall php; # or brew uninstall php72 if you had that before
brew upgrade; # make sure all the other libs are up to date
brew cleanup; # cleanup old files
brew prune; # cleanup old symlinks
brew install autoconf; # Required by pecl
brew install php;
pecl channel-update pecl.php.net;
php --modules | grep 'apcu'; # should not echo apcu, if it does it is already installed, no need to run pecl install apcu then
pecl install apcu; # Install other pecl modules that you are still missing in a similar fashion
php --modules | grep 'apcu'; # should echo apcu
brew services start php; # If you want php fpm and such

You may also need to delete/modify contents of /usr/local/etc/php to remove old modules. If you didn't manually tinker in there I'd say it is save to remove after running brew uninstall php


Edit: Updated to untap from old homebrew/php and update/upgrade brew before installing new php.

@khera
Copy link

khera commented Apr 5, 2018

I found this when trying to update myself to the new way of php via brew. @inoas tip on using pecl is appreciated. I did have to install autoconf as well, but after that it just worked. Thanks!

Overall, I personally find it error-prone to mix and match package managers, but as I'm not able to do the work to keep the packages updated, I cannot complain too much. :)

@fridzema
Copy link

fridzema commented Apr 9, 2018

Try cleaning up /usr/local/etc/php directory (Backup ini) and install php fresh again.

@lock lock bot added the outdated PR was locked due to age label May 9, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

6 participants