Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
macOS php71变为php@7.1用啤酒_Macos_Homebrew - Fatal编程技术网

macOS php71变为php@7.1用啤酒

macOS php71变为php@7.1用啤酒,macos,homebrew,Macos,Homebrew,一天前,我使用brew命令brew安装php71 我试图安装gmp扩展,比如brew安装php71 gmp,但它不起作用,所以我使用了谷歌搜索的某种代码,使我的php71成为php@7.1现在没有一个扩展(比如redis/php71redis)不起作用 现在尝试安装php71,但它仍然安装php@7.1.. 找到homebrew/php/php71并尝试安装,但收到以下消息: Warning: Use php@7.1 instead of deprecated homebrew/php/php7

一天前,我使用brew命令
brew安装php71

我试图安装gmp扩展,比如
brew安装php71 gmp
,但它不起作用,所以我使用了谷歌搜索的某种代码,使我的php71成为php@7.1现在没有一个扩展(比如redis/php71redis)不起作用

现在尝试安装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`
试着用redis mcryt imagic gmp运行php71,等等

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
brew医生转储

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-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
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
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
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
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
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-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命令检查这一点:
which 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
为了修复此问题,我使用自制软件重新安装并重新链接了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

这就是我的工作。我希望它能帮到你。

自从
php71
homebrew/php
移动到
homebrew/core
(大约在3月31日),它被称为
php@7.1

最妙的是,大多数php扩展都已经安装了
php@7.1
。所以我选中了
gmp
扩展也在默认包中。所以无需手动安装(您甚至无法安装),因为它已经打包了
php@7.1
公式

拉取请求:

用它我可以看到
/usr/local/opt/php@7.1/bin/php
和重新安装php71 gmp后,获取
错误:没有名为“php71 gmp”的可用公式
看起来gmp是昨天刚刚添加到7.1.15版本的core中的。().
php-i | grep gmp
的结果是什么?在我的问题中添加了转储:)我真的不明白添加到核心是什么意思?因为我读到php71被添加到核心。。就像php公式一样。。但是安装php72版本。。not 71也不能安装gmp扩展,而且php-v也因此无法工作。。或者pdo…这意味着您不需要安装GMP,因为它现在是用PHP7.1打包的(不管怎样,如果是用自制软件安装的话)。你可能已经有了。但是看起来您的
php
可执行文件没有正确链接。brew链接--overwrite--force--dry run的输出是什么php@7.1能否发布
brew doctor
的结果?另外,
php-v
的输出是什么?我的问题是:)@SarcastronIt说
gmp支持=>已启用
,所以看起来gmp是与php核心一起安装的。您可以备份然后删除
/usr/local/etc/php/7.1/conf.d
我可以备份什么以及如何备份?:O我正在搜索如何恢复macbook 1天(现在需要2天)的所有数据,但未找到任何内容:/php redis未安装。正在尝试重新安装,但它已不存在。如何安装?您可以使用PECL安装。但请确保使用brew php附带的pecl。我现在想安装imagick,但这是一个很大的难题,因为使用“pecl安装imagick”安装它时,需要将文件放入受Mac保护的/usr/include/php/ext/imagick中OS@wouter安装
php@7.1
?我认为您正在尝试使用MacOS附带的php的
pecl
。为了确保运行
哪个pecl
,它应该是这样的
/usr/local/opt/php@7.1/bin/pecl
要使用pecl安装任何php扩展,需要首先链接php包。它应该在/usr/local/bin中链接它们。您还需要确保在路径中/usr/local/bin位于/usr/bin Run
env
之前,以检查此项<代码>brew安装php@7.1
brew链接--强制--覆盖php@7.1
哪一个pecl
响应应该是“/usr/local/bin/pecl”
pecl安装mongodb
(或您想要安装的任何扩展名)要验证它是否已安装,您可以使用:
php-i | grep-i mongo
# 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