微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

macOS php71用brew变成了php@7.1

前一天我用brew命令brew install PHP71安装了普通的PHP71

我试图像brew install PHP71-gmp一样安装gmp扩展但它没有用,所以我使用谷歌搜索的某种代码,使我的PHP71成为PHP@7.1,现在没有扩展(如redis / PHP71-redis) )不工作.

现在尝试安装PHP71但它仍然安装PHP@7.1 ..发现homebrew / PHP / PHP71并尝试安装但后来得到这条消息:

Warning: Use PHP@7.1 instead of deprecated homebrew/PHP/PHP71 
Warning: PHP@7.1 7.1.15 is already installed`

尝试一切运行PHP71与redis mcryt imagic gmp等等..

brew配置:

HOMEBREW_VERSION: 1.5.13
ORIGIN: https://github.com/Homebrew/brew
HEAD: 0f4e22e28d3b65a6c8dbb0f270bb6d262a2429d6
Last commit: 2 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: a59f6d2736fdd1acb3c71380e1e46b861146b609
Core tap last commit: 65 minutes ago
HOMEBREW_PREFIX: /usr/local
cpu: quad-core 64-bit broadwell
Homebrew Ruby: 2.3.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 9.0 build 900
Git: 2.14.3 => /Library/Developer/CommandLinetools/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Java: 1.8.0_162
macOS: 10.13.3-x86_64
Xcode: 9.3
CLT: 9.2.0.0.1.1510905681
X11: N/A

酿造医生转储

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some directories in your path end in a slash.
Directories in your path should not end in a slash. This can break other
doctor checks. The following directories should be edited:
  /Users/pauliuslukosiunas/.composer/vendor/squizlabs/PHP_codesniffer/scripts/

Warning: Some keg-only formulae are linked into the Cellar.
Linking a keg-only formula,such as gettext,into the cellar with
`brew link <formula>` will cause other formulae to detect them during
the `./configure` step. This may cause problems when compiling those
other formulae.

Binaries provided by keg-only formulae may override system binaries
with other strange results.

You may wish to `brew unlink` these brews:
  PHP@7.1

PHP -v转储

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-apcu/apcu.so' - dlopen(/usr/local/opt/PHP71-apcu/apcu.so,9): image not found in UnkNown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-apcu/apcu.so' - dlopen(/usr/local/opt/PHP71-apcu/apcu.so,9): image not found in UnkNown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-gmp/gmp.so' - dlopen(/usr/local/opt/PHP71-gmp/gmp.so,9): image not found in UnkNown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-gmp/gmp.so' - dlopen(/usr/local/opt/PHP71-gmp/gmp.so,9): image not found in UnkNown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-igbinary/igbinary.so' - dlopen(/usr/local/opt/PHP71-igbinary/igbinary.so,9): image not found in UnkNown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-igbinary/igbinary.so' - dlopen(/usr/local/opt/PHP71-igbinary/igbinary.so,9): image not found in UnkNown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-imagick/imagick.so' - dlopen(/usr/local/opt/PHP71-imagick/imagick.so,9): image not found in UnkNown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-imagick/imagick.so' - dlopen(/usr/local/opt/PHP71-imagick/imagick.so,9): image not found in UnkNown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-intl/intl.so' - dlopen(/usr/local/opt/PHP71-intl/intl.so,9): image not found in UnkNown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-intl/intl.so' - dlopen(/usr/local/opt/PHP71-intl/intl.so,9): image not found in UnkNown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-mcrypt/mcrypt.so' - dlopen(/usr/local/opt/PHP71-mcrypt/mcrypt.so,9): image not found in UnkNown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-mcrypt/mcrypt.so' - dlopen(/usr/local/opt/PHP71-mcrypt/mcrypt.so,9): image not found in UnkNown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-pdo-pgsql/pdo_pgsql.so' - dlopen(/usr/local/opt/PHP71-pdo-pgsql/pdo_pgsql.so,9): image not found in UnkNown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-pdo-pgsql/pdo_pgsql.so' - dlopen(/usr/local/opt/PHP71-pdo-pgsql/pdo_pgsql.so,9): image not found in UnkNown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-redis/redis.so' - dlopen(/usr/local/opt/PHP71-redis/redis.so,9): image not found in UnkNown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-redis/redis.so' - dlopen(/usr/local/opt/PHP71-redis/redis.so,9): image not found in UnkNown on line 0
PHP 7.1.15 (cli) (built: Mar 29 2018 09:21:29) ( NTS )
copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0,copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.15,copyright (c) 1999-2018,by Zend Technologies

** PHP -i | grep gmp dump **

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-apcu/apcu.so' - dlopen(/usr/local/opt/PHP71-apcu/apcu.so,9): image not found in UnkNown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/PHP71-gmp/gmp.so' - dlopen(/usr/local/opt/PHP71-gmp/gmp.so,9): image not found in UnkNown on line 0
Configure Command =>  './configure'  '--prefix=/usr/local/Cellar/PHP@7.1/7.1.15' '--localstatedir=/usr/local/var' '--sysconfdir=/usr/local/etc/PHP/7.1' '--with-config-file-path=/usr/local/etc/PHP/7.1' '--with-config-file-scan-dir=/usr/local/etc/PHP/7.1/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-mcrypt=/usr/local/opt/mcrypt' '--with-mhash' '--with-MysqL-sock=/tmp/MysqL.sock' '--with-MysqLi=MysqLnd' '--with-ndbm' '--with-openssl=/usr/local/opt/openssl' '--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-unixODBC=/usr/local/opt/unixodbc' '--with-webp-dir=/usr/local/opt/webp' '--with-xmlrpc' '--with-xsl' '--with-zlib' '--with-curl'
/usr/local/etc/PHP/7.1/conf.d/ext-gmp.ini,gmp
gmp support => enabled

附:我是mac的新手

我有类似的问题,但有不同的扩展.

问题似乎源于我运行升级删除链接.在我的情况下,这导致使用PHP的股票版本.您可以使用CLI命令检查:PHP.

which PHP
# If you see this it's the stock version
/usr/bin/PHP

#If you see this you are using the Homebrew version
/usr/local/bin/PHP

为了解决这个问题,我使用Homebrew重新安装并重新链接PHP

# Reinstall PHP 7.1
brew reinstall PHP@7.1

# check carefully that overwriting links won't break things
brew link --overwrite --force --dry-run PHP@7.1

# Run it for real this time assuming you checked
brew link --overwrite --force PHP@7.1

# Double check that you are Now using homebrew's PHP
which PHP

# This should identify any missing extensions
PHP -v

# Reinstall missing extensions. In my case:
brew reinstall PHP71-xdebug PHP71-imagick

# Check that PHP can find the extension.
PHP -v

这对我有用.我希望它可以帮助你.

原文地址:https://www.jb51.cc/php/133098.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐