美文网首页我爱编程
Mac brew 安装多版本php

Mac brew 安装多版本php

作者: 一周一志 | 来源:发表于2017-12-14 11:15 被阅读0次

Mac brew 安装多版本php,这里我把详细安装信息留存备用,信息里面有很多干货~

➜ ~brew install homebrew/php/php72

==> Installing php72 from homebrew/php

Error: Cannot install homebrew/php/php72 because conflicting formulae are installed.

php70: because different php versions install the same binaries.

Please `brew unlink php70` before continuing.

Unlinking removes a formula's symlinks from /usr/local. You can

link the formula again after the install finishes. You can --force this

install, but the build may fail or cause obscure side-effects in the

resulting software.

➜  ~brew unlink php70      #解绑php70

Unlinking /usr/local/Cellar/php70/7.0.10_1... 17 symlinks removed

➜  ~brew install homebrew/php/php72

Updating Homebrew...

==> Installing php72 from homebrew/php

==> Installing dependencies for homebrew/php/php72: libsodium

==> Installing homebrew/php/php72 dependency: libsodium

==> Downloading https://homebrew.bintray.com/bottles/libsodium-1.0.15.sierra.bottle.tar.gz

######################################################################## 100.0%

==> Pouring libsodium-1.0.15.sierra.bottle.tar.gz

🍺  /usr/local/Cellar/libsodium/1.0.15: 69 files, 959.6KB

==> Installing homebrew/php/php72

==> Downloading https://homebrew.bintray.com/bottles-php/php72-7.2.0_11.sierra.bottle.tar.gz

######################################################################## 100.0%

==> Pouring php72-7.2.0_11.sierra.bottle.tar.gz

==> Caveats

The php.ini file can be found in:

/usr/local/etc/php/7.2/php.ini

✩✩✩✩ Extensions ✩✩✩✩

If you are having issues with custom extension compiling, ensure that you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:

PATH="/usr/local/bin:$PATH"

PHP72 Extensions will always be compiled against this PHP. Please install them using --without-homebrew-php to enable compiling against system PHP.

✩✩✩✩ PHP CLI ✩✩✩✩

If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc, ~/.zshrc, ~/.profile or your shell's equivalent configuration file:

export PATH="$(brew --prefix homebrew/php/php72)/bin:$PATH"

✩✩✩✩ FPM ✩✩✩✩

To launch php-fpm on startup:

mkdir -p ~/Library/LaunchAgents

cp /usr/local/opt/php72/homebrew.mxcl.php72.plist ~/Library/LaunchAgents/

launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php72.plist

The control script is located at /usr/local/opt/php72/sbin/php72-fpm

OS X 10.8 and newer come with php-fpm pre-installed, to ensure you are using the brew version you need to make sure /usr/local/sbin is before /usr/sbin in your PATH:

PATH="/usr/local/sbin:$PATH"

You may also need to edit the plist to use the correct "UserName".

Please note that the plist was called 'homebrew-php.josegonzalez.php72.plist' in old versions of this formula.

With the release of macOS Sierra the Apache module is now not built by default. If you want to build it on your system you have to install php with the --with-httpd option. See  brew options php72 for more details.

To have launchd start homebrew/php/php72 now and restart at login:

brew services start homebrew/php/php72

==> Summary

🍺  /usr/local/Cellar/php72/7.2.0_11: 350 files, 46.6MB

➜  ~ export PATH="$(brew --prefix homebrew/php/php72)/bin:$PATH"

➜  ~ php -v

PHP 7.2.0 (cli) (built: Dec  3 2017 21:47:51) ( NTS )

Copyright (c) 1997-2017 The PHP Group

Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies

(ps: 安装完成)

相关文章

  • Mac brew 安装多版本php

    Mac brew 安装多版本php,这里我把详细安装信息留存备用,信息里面有很多干货~ ➜ ~brew inst...

  • mac平台多个php版本快速切换

    ** 要求所有php版本都是由brew安装 ** 使用brew安装php多版本方法 安装切换工具: 查看当前安装的...

  • 在mac下安装各php版本

    mac安装php最方便的就是brew。但是吧brew上面旧版本是没法下载的。想要在mac上搭建各版本php,并方便...

  • mac + php + nginx + redis扩展

    安装php 无需将mac自带版本删除,通过brew安装需要版本php,例如7.4版本,将会安装到目录‘/usr/l...

  • mac下brew安装php及多版本方法

    mac下brew安装php及多版本方法 前言 今天执行一个php脚本,发现竟然php7.1下大量mcrypt不兼容...

  • Mac 配置php环境

    工具:brew,好用的Mac安装软件的工具 一、安装php环境 Mac自带了php环境,但是无论从版本、功能还是开...

  • mac 通过HomeBrew升级php版本

    MAC升级php版本 用brew安装过php的要先卸载php,第一次安装可以直接以下命令

  • mac系统php多版本共存

    目前安装的版本 php8.0.2 brew install php 默认的版本,这里再次安装其他版本 brew ...

  • Mac下PHP多版本切换

    安装php多版本 Mac下默认安装了php但是版本不是很高,用php -v查看php版本是php 5.6,我们希望...

  • php多版本共存

    环境 mac Cataline下使用brew方式安装 nginx php5.6和php7.2 安装brew 安装p...

网友评论

    本文标题:Mac brew 安装多版本php

    本文链接:https://www.haomeiwen.com/subject/vhihwxtx.html