brewでphp7をインストールした際のエラー対応

1. brewコマンドでPHP7をインストール
 vagrant $ brew install homebrew/php/php70
==> Tapping homebrew/php
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-php'...
remote: Counting objects: 658, done.
remote: Compressing objects: 100% (426/426), done.
remote: Total 658 (delta 375), reused 410 (delta 230), pack-reused 0
Receiving objects: 100% (658/658), 301.89 KiB | 319.00 KiB/s, done.
Resolving deltas: 100% (375/375), done.
Checking connectivity... done.
Tapped 633 formulae (673 files, 1.2M)
==> Installing php70 from homebrew/php
==> Installing dependencies for homebrew/php/php70: libpng, freetype, gettext, icu4c, jpeg, libxml2, unixodbc
==> Installing homebrew/php/php70 dependency: libpng
==> Downloading https://homebrew.bintray.com/bottles/libpng-1.6.25.sierra.bottle
######################################################################## 100.0%
==> Pouring libpng-1.6.25.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libpng/1.6.25: 25 files, 1.2M
==> Installing homebrew/php/php70 dependency: freetype
==> Downloading https://homebrew.bintray.com/bottles/freetype-2.7.sierra.bottle.
######################################################################## 100.0%
==> Pouring freetype-2.7.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/freetype/2.7: 61 files, 2.4M
==> Installing homebrew/php/php70 dependency: gettext
==> Downloading https://homebrew.bintray.com/bottles/gettext-0.19.8.1.sierra.bot
######################################################################## 100.0%
==> Pouring gettext-0.19.8.1.sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

macOS provides the BSD gettext library and some software gets confused if both are in the library path.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/gettext/lib
    CPPFLAGS: -I/usr/local/opt/gettext/include

==> Summary
🍺  /usr/local/Cellar/gettext/0.19.8.1: 1,934 files, 16.9M
==> Installing homebrew/php/php70 dependency: icu4c
==> Downloading https://homebrew.bintray.com/bottles/icu4c-57.1.sierra.bottle.ta
######################################################################## 100.0%
==> Pouring icu4c-57.1.sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

macOS provides libicucore.dylib (but nothing else).

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/icu4c/lib
    CPPFLAGS: -I/usr/local/opt/icu4c/include
    PKG_CONFIG_PATH: /usr/local/opt/icu4c/lib/pkgconfig

==> Summary
🍺  /usr/local/Cellar/icu4c/57.1: 265 files, 65.0M
==> Installing homebrew/php/php70 dependency: jpeg
==> Downloading https://homebrew.bintray.com/bottles/jpeg-8d.sierra.bottle.2.tar
######################################################################## 100.0%
==> Pouring jpeg-8d.sierra.bottle.2.tar.gz
🍺  /usr/local/Cellar/jpeg/8d: 19 files, 708.2K
==> Installing homebrew/php/php70 dependency: libxml2
==> Downloading https://homebrew.bintray.com/bottles/libxml2-2.9.4.sierra.bottle
######################################################################## 100.0%
==> Pouring libxml2-2.9.4.sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/libxml2/lib
    CPPFLAGS: -I/usr/local/opt/libxml2/include
    PKG_CONFIG_PATH: /usr/local/opt/libxml2/lib/pkgconfig

==> Summary
🍺  /usr/local/Cellar/libxml2/2.9.4: 276 files, 9.8M
==> Installing homebrew/php/php70 dependency: unixodbc
==> Downloading https://homebrew.bintray.com/bottles/unixodbc-2.3.4.sierra.bottl
######################################################################## 100.0%
==> Pouring unixodbc-2.3.4.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/unixodbc/2.3.4: 39 files, 952.4K
==> Installing homebrew/php/php70
==> Downloading https://homebrew.bintray.com/bottles-php/php70-7.0.13_6.sierra.b
######################################################################## 100.0%
==> Pouring php70-7.0.13_6.sierra.bottle.tar.gz
==> Caveats
The php.ini file can be found in:
    /usr/local/etc/php/7.0/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"

PHP70 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/php70)/bin:$PATH"

✩✩✩✩ FPM ✩✩✩✩

To launch php-fpm on startup:
    mkdir -p ~/Library/LaunchAgents
    cp /usr/local/opt/php70/homebrew.mxcl.php70.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php70.plist

The control script is located at /usr/local/opt/php70/sbin/php70-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.php70.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-apache option. See  brew options php70  for more details.

To have launchd start homebrew/php/php70 now and restart at login:
  brew services start homebrew/php/php70
==> Summary
🍺  /usr/local/Cellar/php70/7.0.13_6: 332 files, 38.5M
2. PHPのバージョンを確認
 
$ php -v
dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
  Referenced from: /usr/local/opt/php70/bin/php
  Reason: Incompatible library version: php requires version 43.0.0 or later, but libpng16.16.dylib provides version 42.0.0
Abort trap: 6
3. libpngが古いよなので、アップデート
 
$ brew upgrade libpng
==> Upgrading 1 outdated package, with result:
libpng 1.6.26
==> Upgrading libpng
==> Downloading https://homebrew.bintray.com/bottles/libpng-1.6.26.sierra.bottle
######################################################################## 100.0%
==> Pouring libpng-1.6.26.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libpng/1.6.26: 26 files, 1.2M
4. PHPのバージョンを確認。
 
$ php -v
PHP 7.0.13 (cli) (built: Nov 15 2016 23:52:36) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

コメント

このブログの人気の投稿

HealKit HKObjectType 一覧

クラッシュ時のスタックトレース取得方法

Undefined symbols for architecture arm64