After brew update to 1.5 php71 deprecated and extensions hidden

(Paulius Lukosiunas) #1

after this update php71 became php@7.1 and extensions were removed and not working anymore… So is it possible to install php version 7.1 with imagick, redis, gmp, igbinary and lots of others extenesions which is needed for projects? :open_mouth:

before it was very simple like brew install php71-redis now it’s removed and no suggested how to install php71 with redis and other… HELP!

(Eduard Rozenberg) #2

It’s possible, and also read recent postings here about php and extensions.

One thing to consider - moving to php 7.2. All your code should run (no guarantees though). To move to php 7.2 uninstall all your php71 packages and addons, and $ brew install php.

With either homebrew php 7.1 or 7.2, a bunch of extensions are now built in. Config for the standard php (7.2) [scroll the line to view it all, or copy paste in an editor for easier viewing]:

'./configure' '--prefix=/usr/local/Cellar/php/7.2.4' '--localstatedir=/usr/local/var' '--sysconfdir=/usr/local/etc/php/7.2' '--with-config-file-path=/usr/local/etc/php/7.2' '--with-config-file-scan-dir=/usr/local/etc/php/7.2/conf.d' '--enable-bcmath' '--enable-calendar' '--enable-dba' '--enable-dtrace' '--enable-exif' '--enable-ftp' '--enable-fpm' '--enable-intl' '--enable-mbregex' '--enable-mbstring' '--enable-mysqlnd' '--enable-opcache-file' '--enable-pcntl' '--enable-phpdbg' '--enable-phpdbg-webhelper' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--enable-zip' '--with-apxs2=/usr/local/opt/httpd/bin/apxs' '--with-bz2' '--with-fpm-user=_www' '--with-fpm-group=_www' '--with-freetype-dir=/usr/local/opt/freetype' '--with-gd' '--with-gettext=/usr/local/opt/gettext' '--with-gmp=/usr/local/opt/gmp' '--with-icu-dir=/usr/local/opt/icu4c' '--with-jpeg-dir=/usr/local/opt/jpeg' '--with-kerberos' '--with-layout=GNU' '--with-ldap' '--with-ldap-sasl' '--with-libedit' '--with-libzip' '--with-mhash' '--with-mysql-sock=/tmp/mysql.sock' '--with-mysqli=mysqlnd' '--with-ndbm' '--with-openssl=/usr/local/opt/openssl' '--with-password-argon2=/usr/local/opt/argon2' '--with-pdo-dblib=/usr/local/opt/freetds' '--with-pdo-mysql=mysqlnd' '--with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc' '--with-pdo-pgsql=/usr/local/opt/libpq' '--with-pgsql=/usr/local/opt/libpq' '--with-pic' '--with-png-dir=/usr/local/opt/libpng' '--with-pspell=/usr/local/opt/aspell' '--with-sodium=/usr/local/opt/libsodium' '--with-unixODBC=/usr/local/opt/unixodbc' '--with-webp-dir=/usr/local/opt/webp' '--with-xmlrpc' '--with-xsl' '--with-zlib' '--with-curl'

For stuff that isn’t built in, use pear or pecl to install. For ex.

$ pecl channel-update
$ pecl search redis
$ pecl install redis

The redis module will most likely get installed to /usr/local/lib/php/pecl/<some-date-stamp>, and a line automatically added to your php.ini. Restarting httpd required.

(Paulius Lukosiunas) #3

So this configuration if by default included to php72 (brew php) ? or do I need to put it somewhere?
by the way… BIG THANKS for answer and putting me on road with redis, I definitely will try this :wink:

(Eduard Rozenberg) #4

No need to do anything with that config line. It’s just to show what standard options are included in the homebrew php bottle.

(Paulius Lukosiunas) #5

Yea… I saw that… but seems like php72 is not suitable for me for these projects… neither and php70… :confused:

(Eduard Rozenberg) #6

Maybe not suitable “out of the box”, but suitable once you get comfortable with installing and compiling your own extensions. A bit painful at first, but good skills to have.

(Travis Detert) #7

I can also confirm that this is horribly broken and at this point I have several developers that are just unable to do anything until we resolve this. In general, what once worked great for years is not seemingly irreparably broken. I see no way whatsoever to resolve missing extensions, memcached, and redis in the documentation.

I don’t understand why the existing packages that once worked fine are now just gone? Why? We cannot use php72 because it is unsupported by the ecommerce packages we’re using. What do you guys advise here?

I don’t understand why the multiple versions issue seems to have gotten WORSE over time?

In general, brew has been breaking pretty often lately, and while beggars can’t be choosers I’ll admit, I would like to understand more why this situation is so bad?

(Eduard Rozenberg) #8

$ brew search php shows php@5.6, php@7.0, php@7.1. The “regular” php is 7.2

Use whichever version works with your ecom packages and you’ll obviously still need to install other php modules and extensions with pear, pecl, or compile from source. Either from php’s own source (imap for ex.), or separate source downloads (xdebug for example).

(Travis Detert) #9

Hi! Thanks for the quick response. I’m curious why there aren’t just packages for those extensions instead of having to compile these? That strategy was working great, why do we now have to build these from source or use pecl?

(Eduard Rozenberg) #10

I think they can’t handle the large number of formulas needed to cover all the possible PHP modules, and especially having to maintain them constantly as new versions are released. Just too much work.

Linux distributions do this kind of thing all the time. Gnome becomes too much work to maintain - droppped by some distros, have to compile it yourself or rely on 3rd parties.

This is the new homebrew php reality - you get basic php with a few common modules built-in, and for the rest have to install your own.

(Mike McQuaid) #11

That’s an issue for your organisation to resolve and learn from. As mentioned in the other thread: this was announced in advance and you clearly did not make adequate preparations.

Again, this is worth a read:

(Christopher Schmitz) #12

If a homebrew update blew up your php enviroment (like upgrading a python package did for me this morning), and you’re trying to install xdebug, check out this post:

(Christopher Schmitz) #13

I’m still grappling a bit with getting pdo_pgsql working so if anyone runs into a fix hit me up!

(Paulius Lukosiunas) #14

I everything setted up with pear (pecl) installations with brew php@7.1 works perfectly :slight_smile:

(Serious Cl) #15