Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.63k stars 12.36k forks source link

I can't install PHP 7.2.4 with more options which are ignored #26082

Closed gusbemacbe closed 6 years ago

gusbemacbe commented 6 years ago

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

To help us debug your issue please explain:

Warning: The post-install step did not complete successfully
You can try again using `brew postinstall php`
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so

    <FilesMatch .php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /usr/local/etc/php/7.2/

To have launchd start php now and restart at login:
  brew services start php
Or, if you don't want/need a background service you can just run:
  php-fpm
==> Summary
🍺  /usr/local/Cellar/php/7.2.4: 515 files, 78.9MB

b. Running php -v:

PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/curl (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/curl, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/curl.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/curl.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/curl (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/curl, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/curl.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/curl.so, 9): image not found)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'gettext' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/gettext (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/gettext, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/gettext.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/gettext.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'gettext' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/gettext (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/gettext, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/gettext.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/gettext.so, 9): image not found)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/intl (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/intl, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/intl.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/intl.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/intl (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/intl, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/intl.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/intl.so, 9): image not found)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/mbstring (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/mbstring, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/mbstring.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/mbstring.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'mbstring' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/mbstring (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/mbstring, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/mbstring.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/mbstring.so, 9): image not found)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'openssl' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/openssl (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/openssl, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/openssl.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/openssl.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/openssl (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/openssl, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/openssl.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/openssl.so, 9): image not found)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'soap' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/soap (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/soap, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/soap.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/soap.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'soap' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/soap (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/soap, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/soap.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/soap.so, 9): image not found)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'sockets' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/sockets (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/sockets, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/sockets.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/sockets.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'sockets' (tried: /usr/local/Cellar/php/7.2.4/lib/php/20170718/sockets (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/sockets, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718/sockets.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718/sockets.so, 9): image not found)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php72-gmp/gmp.so' (tried: /usr/local/opt/php72-gmp/gmp.so (dlopen(/usr/local/opt/php72-gmp/gmp.so, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718//usr/local/opt/php72-gmp/gmp.so.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718//usr/local/opt/php72-gmp/gmp.so.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php72-gmp/gmp.so' (tried: /usr/local/opt/php72-gmp/gmp.so (dlopen(/usr/local/opt/php72-gmp/gmp.so, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718//usr/local/opt/php72-gmp/gmp.so.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718//usr/local/opt/php72-gmp/gmp.so.so, 9): image not found)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php72-imagick/imagick.so' (tried: /usr/local/opt/php72-imagick/imagick.so (dlopen(/usr/local/opt/php72-imagick/imagick.so, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718//usr/local/opt/php72-imagick/imagick.so.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718//usr/local/opt/php72-imagick/imagick.so.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php72-imagick/imagick.so' (tried: /usr/local/opt/php72-imagick/imagick.so (dlopen(/usr/local/opt/php72-imagick/imagick.so, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718//usr/local/opt/php72-imagick/imagick.so.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718//usr/local/opt/php72-imagick/imagick.so.so, 9): image not found)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php72-intl/intl.so' (tried: /usr/local/opt/php72-intl/intl.so (dlopen(/usr/local/opt/php72-intl/intl.so, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718//usr/local/opt/php72-intl/intl.so.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718//usr/local/opt/php72-intl/intl.so.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php72-intl/intl.so' (tried: /usr/local/opt/php72-intl/intl.so (dlopen(/usr/local/opt/php72-intl/intl.so, 9): image not found), /usr/local/Cellar/php/7.2.4/lib/php/20170718//usr/local/opt/php72-intl/intl.so.so (dlopen(/usr/local/Cellar/php/7.2.4/lib/php/20170718//usr/local/opt/php72-intl/intl.so.so, 9): image not found)) in Unknown on line 0
PHP 7.2.4 (cli) (built: Mar 29 2018 15:19:46) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
  1. As the ancient formulae as php72 and php72-* were removed and I wasn't aware that php72-* were removed too, I changed php72 to php:
brew install php && brew install --with-homebrew-curl --with-httpd php
brew install php-cs-fixer composer
brew install mcrypt 
brew install php-code-sniffer 
brew install php-install 
brew install php-gmp 
brew install php-imagick 
brew install php-intl 
brew install php-v8js 
brew install phpmyadmin 
brew install phpunit
  1. I understood they were removed, I ran the commands:
brew reinstall php && brew reinstall --with-homebrew-curl --with-httpd php
  1. But I still have those same errors in the items (a) and (b). I solved following a contributor's instructions and checked php.rb:
brew rm php
brew fetch -f php
brew install php
brew install --enable-fpm --enable-intl --enable-mbstring --enable-soap --enable-sockets --with-curl --with-homebrew-curl --with-httpd php

Unfortunately all these options were ignored and I have still the same errors

Formulae list:

apr                     gdbm                    libidn2                 pcre
apr-util                gettext                 libpng                  php
argon2                  git                     libpq                   php-code-sniffer
aspell                  glib                    libsodium               php-cs-fixer
autoconf                gmp                     libtiff                 phpmyadmin
automake                httpd                   libtool                 phpunit
boost                   icu4c                   libunistring            pkg-config
brotli                  ilmbase                 libxml2                 python
c-ares                  imagemagick             libzip                  python3
cabextract              jansson                 maven                   readline
cmake                   jemalloc                mcrypt                  sqlite
composer                jpeg                    mhash                   tbb
curl                    libev                   nghttp2                 unixodbc
eigen                   libevent                node                    webp
freetds                 libffi                  openexr                 wget
freetype                libiconv                openssl                 xz

Versions

OS version: macOS High Sierra 10.13.3 which php: /usr/local/bin/php

Romain commented 6 years ago

Encountering the same errors than @gusbemacbe with php@7.1. Doing a simple brew upgrade screwed all my PHP setup. I would be interested in knowing how to properly migrate to this new tap and be able to install required dependencies.

kabel commented 6 years ago

All of the above mentioned core php extensions are now built statically (see output from php -m or /usr/local/opt/php@7.1/bin/php -m). You configuration file(s) (which were not touched by the migration) will need to be adjusted to take out any line that is referencing a shared extension (extension=). The php formulae in Homebrew/core do not have any build options, so the bottle build should be fine (brew install php).

The post_install warning you are seeing is likely from a bad source build that reacted to old configuration files you have. Reviewing your homebrew logs (which you checked the box for, but didn't include) would show exactly what went wrong.

gusbemacbe commented 6 years ago

@kabel, I do not use PHP 7.1, I use PHP 7.2. Who uses it is @Romain.

kabel commented 6 years ago

Sorry. Assuming PHP 7.2 is the linked version php -m, otherwise, /usr/local/opt/php/bin/php -m. Also review your config at /usr/local/etc/php/7.2/php.ini.

gusbemacbe commented 6 years ago

I have already modified /usr/local/etc/php/7.2/php.ini to uncomment the extensions I needed and I also have reviewed php-fpm and added a loadmodule and a fileswatch to httpd as I have said in the first comment, but I have still the same errors of postinstall and of missed extensions/modules. I'll test php -m on macOS when I will be home, because I am on Ubuntu now at college.

kabel commented 6 years ago

There is nothing to uncomment in the default config, the extensions you are looking for are just built in (no config needed). [EDIT] Those lines are in the default config mainly for Windows users.

The warning are coming from bad/old config from the previous tap. If you keep having issues, back up your /usr/local/etc/php/7.2/ directory, remove it, and do a reinstall with only brew install php.

gusbemacbe commented 6 years ago

here is nothing to uncomment in the default config, the extensions you are looking for are just built in (no config needed). do a reinstall with only brew install php

WIll it enable automatically all extensions I need?

kabel commented 6 years ago

Yes. That's what I mean by "built in".

gusbemacbe commented 6 years ago

OK, at home, firstly I will test php -m, and if I have still the same erros, I will back up and remove the folder user/local/etc/php.

imajinyun commented 6 years ago

@gusbemacbe You may need to install the extension through pecl

gusbemacbe commented 6 years ago

@kabel

I have just tested...

  1. Running php -m, all the extensions that I needed are present, but I had still the same errors.
  2. I runned brew install php and I was asked to reinstall. Then I runned brew reinstall php, but I have still only one error of postinstall.
  3. I runned brew postinstall php and it gave an error: Error: Permission denied @ rb_sysopen - /usr/local/var/log/php-fpm.log.
  4. I tested php -v and no errors. Good. But the error of postinstall is unsolved.

@imajinyun, the formula pecl has been removed from homebrew/core together with the ancient formulae.

gusbemacbe commented 6 years ago

Here is the php-fpm.og:

[03-Apr-2018 00:45:41] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[03-Apr-2018 00:45:41] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[03-Apr-2018 00:45:41] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[03-Apr-2018 00:45:41] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[03-Apr-2018 00:45:41] NOTICE: fpm is running, pid 2809
[03-Apr-2018 00:45:41] NOTICE: ready to handle connections
imajinyun commented 6 years ago

@gusbemacbe See #16067

gusbemacbe commented 6 years ago

@imajinyun, ah, I ran brew list php and it says it has already pecl:

brew list php
/usr/local/Cellar/php/7.2.4/.bottle/etc/ (4 files)
/usr/local/Cellar/php/7.2.4/.bottle/var/log/php-fpm.log
/usr/local/Cellar/php/7.2.4/bin/pear
/usr/local/Cellar/php/7.2.4/bin/peardev
/usr/local/Cellar/php/7.2.4/bin/pecl
/usr/local/Cellar/php/7.2.4/bin/phar
/usr/local/Cellar/php/7.2.4/bin/phar.phar
/usr/local/Cellar/php/7.2.4/bin/php
/usr/local/Cellar/php/7.2.4/bin/php-cgi
/usr/local/Cellar/php/7.2.4/bin/php-config
/usr/local/Cellar/php/7.2.4/bin/phpdbg
/usr/local/Cellar/php/7.2.4/bin/phpize
/usr/local/Cellar/php/7.2.4/homebrew.mxcl.php.plist
/usr/local/Cellar/php/7.2.4/include/php/ (311 files)
/usr/local/Cellar/php/7.2.4/lib/httpd/modules/libphp7.so
/usr/local/Cellar/php/7.2.4/lib/php/ (14 files)
/usr/local/Cellar/php/7.2.4/sbin/php-fpm
/usr/local/Cellar/php/7.2.4/share/man/ (8 files)
/usr/local/Cellar/php/7.2.4/share/pear/ (158 files)
/usr/local/Cellar/php/7.2.4/share/php/fpm/status.html

But the error of postinstall is still unsolved.

ilovezfs commented 6 years ago

Set ownership and permissions on those files such that your user can modify them and then re-run postinstall.