質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

Q&A

解決済

1回答

4997閲覧

anyenvで導入したphpenv(php-build含)でPHPをインストールできません

sounisi5011

総合スコア697

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

0グッド

1クリップ

投稿2016/10/11 14:57

###環境

####ハード

MacBook Air (13-inch, Early 2015)

####OS

OS X El Capitan 10.11.6(15G1004)

####CPU

2.2 GHz Intel Core i7

###前提・実現したいこと

anyenvを使用して導入したphpenvでPHPのインストールしたいと考えています。
が、「BUILD ERROR」と表示されてしまい、インストールできません。
情報を探しましたが有効な解決方法を見つけられず、現在も解決できていません。

このエラーを無くし、PHPのインストールを成功させたいです。

###anyenv導入のために実行したコマンド

bash

1$ brew install re2c # re2cをインストール 2==> Auto-updated Homebrew! 3Updated 1 tap (homebrew/core). 4==> Updated Formulae 5afl-fuzz cppcheck gauge jbake pdf2htmlex poppler 6armor diff-pdf imagemagick ✔ khal pdftoedn yank 7==> Deleted Formulae 8automoc4 cuty_capt frescobaldi rcssserver sqliteman valkyrie 9 10==> Downloading https://homebrew.bintray.com/bottles/re2c-0.15.3.el_capitan.bottle.tar.gz 11######################################################################## 100.0% 12==> Pouring re2c-0.15.3.el_capitan.bottle.tar.gz 13???? /usr/local/Cellar/re2c/0.15.3: 5 files, 397.3K

bash

1$ brew install bison # bisonをインストール 2==> Downloading https://homebrew.bintray.com/bottles/bison-3.0.4.el_capitan.bottle.tar.gz 3######################################################################## 100.0% 4==> Pouring bison-3.0.4.el_capitan.bottle.tar.gz 5==> Caveats 6This formula is keg-only, which means it was not symlinked into /usr/local. 7 8Some formulae require a newer version of bison. 9 10Generally there are no consequences of this for you. If you build your 11own software and it requires this formula, you'll need to add to your 12build variables: 13 14 LDFLAGS: -L/usr/local/opt/bison/lib 15 16==> Summary 17???? /usr/local/Cellar/bison/3.0.4: 51 files, 2.1M

bash

1$ git clone https://github.com/riywo/anyenv ~/.anyenv # anyenvをインストール 2Cloning into '/Users/sounisi5011/.anyenv'... 3remote: Counting objects: 250, done. 4remote: Total 250 (delta 0), reused 0 (delta 0), pack-reused 250 5Receiving objects: 100% (250/250), 38.92 KiB | 49.00 KiB/s, done. 6Resolving deltas: 100% (96/96), done.

bash

1$ exec bash -l # bashを再起動

bash

1$ mkdir -p $(anyenv root)/plugins # anyenvのプラグイン用ディレクトリを作成

bash

1$ git clone https://github.com/znz/anyenv-update.git $(anyenv root)/plugins/anyenv-update # anyenv-updateを導入 2Cloning into '/Users/sounisi5011/.anyenv/plugins/anyenv-update'... 3remote: Counting objects: 65, done. 4remote: Total 65 (delta 0), reused 0 (delta 0), pack-reused 65 5Unpacking objects: 100% (65/65), done.

bash

1$ git clone https://github.com/znz/anyenv-git.git $(anyenv root)/plugins/anyenv-git # anyenv-gitを導入 2Cloning into '/Users/sounisi5011/.anyenv/plugins/anyenv-git'... 3remote: Counting objects: 40, done. 4Unpacking objects: 100% (40/40), done. 5remote: Total 40 (delta 0), reused 0 (delta 0), pack-reused 40

bash

1$ git clone git://github.com/aereal/anyenv-exec.git $(anyenv root)/plugins/anyenv-exec # anyenv-execを導入 2Cloning into '/Users/sounisi5011/.anyenv/plugins/anyenv-exec'... 3remote: Counting objects: 10, done. 4remote: Total 10 (delta 0), reused 0 (delta 0), pack-reused 10 5Receiving objects: 100% (10/10), done.

bash

1$ anyenv install phpenv # anyenvでphpenvをインストール 2/var/folders/gp/1q851dbd1mz6rh98z7p2_4p40000gn/T/phpenv.20161011225405.894 ~ 3Cloning https://github.com/madumlao/phpenv.git... 4Cloning into 'phpenv'... 5remote: Counting objects: 1116, done. 6remote: Total 1116 (delta 0), reused 0 (delta 0), pack-reused 1116 7Receiving objects: 100% (1116/1116), 213.27 KiB | 53.00 KiB/s, done. 8Resolving deltas: 100% (692/692), done. 9~ 10~/.anyenv/envs/phpenv/plugins ~ 11Cloning https://github.com/php-build/php-build.git... 12Cloning into 'php-build'... 13remote: Counting objects: 4569, done. 14remote: Compressing objects: 100% (3/3), done. 15remote: Total 4569 (delta 4), reused 3 (delta 3), pack-reused 4563 16Receiving objects: 100% (4569/4569), 666.12 KiB | 83.00 KiB/s, done. 17Resolving deltas: 100% (2797/2797), done. 18~ 19~/.anyenv/envs/phpenv/plugins ~ 20Cloning https://github.com/ngyuki/phpenv-composer... 21Cloning into 'phpenv-composer'... 22remote: Counting objects: 60, done. 23remote: Total 60 (delta 0), reused 0 (delta 0), pack-reused 60 24Unpacking objects: 100% (60/60), done. 25~ 26 27Install phpenv succeeded! 28Please reload your profile (exec $SHELL -l) or open a new session.

bash

1$ exec bash -l # bashを再起動

bash

1$ cat ~/.anyenv/envs/phpenv/plugins/php-build/share/php-build/default_configure_options # default_configure_optionsの内容を表示 2--without-pear 3--with-gd 4--enable-sockets 5--with-jpeg-dir=/usr 6--with-png-dir=/usr 7--enable-exif 8--enable-zip 9--with-zlib 10--with-zlib-dir=/usr 11--with-kerberos 12--with-openssl 13--with-mcrypt=/usr 14--enable-soap 15--enable-xmlreader 16--with-xsl 17--enable-ftp 18--enable-cgi 19--with-curl=/usr 20--with-tidy 21--with-xmlrpc 22--enable-sysvsem 23--enable-sysvshm 24--enable-shmop 25--with-mysql=mysqlnd 26--with-mysqli=mysqlnd 27--with-pdo-mysql=mysqlnd 28--with-pdo-sqlite 29--enable-pcntl 30--with-readline 31--enable-mbstring 32--disable-debug 33--enable-fpm 34--enable-bcmath

bash

1$ sed -i '' '/^--with-mysql=/d' ~/.anyenv/envs/phpenv/plugins/php-build/share/php-build/default_configure_options # default_configure_optionsから`--with-mysql`の行を削除する

bash

1$ echo 'YACC=/usr/local/opt/bison/bin/bison' >> ~/.anyenv/envs/phpenv/plugins/php-build/share/php-build/default_configure_options # default_configure_optionsにbisonのパスを追加

bash

1$ cat ~/.anyenv/envs/phpenv/plugins/php-build/share/php-build/default_configure_options # default_configure_optionsの内容を表示 2--without-pear 3--with-gd 4--enable-sockets 5--with-jpeg-dir=/usr 6--with-png-dir=/usr 7--enable-exif 8--enable-zip 9--with-zlib 10--with-zlib-dir=/usr 11--with-kerberos 12--with-openssl 13--with-mcrypt=/usr 14--enable-soap 15--enable-xmlreader 16--with-xsl 17--enable-ftp 18--enable-cgi 19--with-curl=/usr 20--with-tidy 21--with-xmlrpc 22--enable-sysvsem 23--enable-sysvshm 24--enable-shmop 25--with-mysqli=mysqlnd 26--with-pdo-mysql=mysqlnd 27--with-pdo-sqlite 28--enable-pcntl 29--with-readline 30--enable-mbstring 31--disable-debug 32--enable-fpm 33--enable-bcmath 34YACC=/usr/local/opt/bison/bin/bison

###発生している問題・エラーメッセージ

bash

1$ phpenv install 7.0.7 2[Info]: Loaded extension plugin 3[Info]: Loaded apc Plugin. 4[Info]: Loaded composer Plugin. 5[Info]: Loaded github Plugin. 6[Info]: Loaded uprofiler Plugin. 7[Info]: Loaded xdebug Plugin. 8[Info]: Loaded xhprof Plugin. 9[Info]: php.ini-production gets used as php.ini 10[Info]: Building 7.0.7 into /Users/sounisi5011/.anyenv/envs/phpenv/versions/7.0.7 11[Skipping]: Already downloaded and extracted https://secure.php.net/distributions/php-7.0.7.tar.bz2 12[Preparing]: /var/tmp/php-build/source/7.0.7 13 14----------------- 15| BUILD ERROR | 16----------------- 17 18Here are the last 10 lines from the log: 19 20----------------------------------------- 21configure: error: build test failed. Please check the config.log for details. 22----------------------------------------- 23 24The full Log is available at '/tmp/php-build.7.0.7.20161011231143.log'. 25[Warn]: Aborting build.

php-build.7.0.7.20161011231143.logの内容:

configure: error: build test failed. Please check the config.log for details.

config.logの内容:

http://pastebin.com/vy6Z8ETY

※10461行のテキストデータです。重いページなので、開く前に十分注意してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

以上の記事で行っていたことを真似てみたところ成功しました。
以下、実行したコマンドを記載します…


openssl、libxml2、mcryptをインストール

bash

1$ brew install openssl 2==> Auto-updated Homebrew! 3Updated 4 taps (homebrew/core, homebrew/dupes, homebrew/php, homebrew/versions). 4==> New Formulae 5binwalk osrm-backend sql-translator 6hesiod piknik 7homebrew/versions/varnish4 rmlint 8==> Updated Formulae 9ace geckodriver metabase shadowsocks-libev 10android-ndk git-credential-manager metaproxy shyaml 11ansible-cmdb git-lfs micro sonarqube 12antigen glib monkeysphere ssdb 13aqbanking gnuplot mutt tailor 14asciinema2gif gofabric8 offlineimap tmux 15avro-c gstreamermm open-babel tomcat 16aws-sdk-cpp gtkextra opencsg vala 17bash-git-prompt gx oysttyer vdirsyncer 18bitrise gx-go pazpar2 verilator 19cake ice pcap_dnsproxy vim 20cern-ndiff imagemagick ✔ pgroonga wine 21chaiscript jenkins plantuml x265 22cjdns khard ponyc xonsh 23commandbox knot prometheus yazpp 24consul-backinator ldns python you-get 25djview4 libiscsi python3 youtube-dl 26doctl libnfs remctl zplug 27elixir macvim rswift zsh-navigation-tools 28fabio mailhog rtv 29file-roller meson s-search 30 31==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2j.el_capitan.bottle.tar.gz 32######################################################################## 100.0% 33==> Pouring openssl-1.0.2j.el_capitan.bottle.tar.gz 34==> Using the sandbox 35==> Caveats 36A CA file has been bootstrapped using certificates from the system 37keychain. To add additional certificates, place .pem files in 38 /usr/local/etc/openssl/certs 39 40and run 41 /usr/local/opt/openssl/bin/c_rehash 42 43This formula is keg-only, which means it was not symlinked into /usr/local. 44 45Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries 46 47Generally there are no consequences of this for you. If you build your 48own software and it requires this formula, you'll need to add to your 49build variables: 50 51 LDFLAGS: -L/usr/local/opt/openssl/lib 52 CPPFLAGS: -I/usr/local/opt/openssl/include 53 54==> Summary 55???? /usr/local/Cellar/openssl/1.0.2j: 1,695 files, 12M

bash

1$ brew install libxml2 2==> Downloading https://homebrew.bintray.com/bottles/libxml2-2.9.4.el_capitan.bottle.tar.gz 3######################################################################## 100.0% 4==> Pouring libxml2-2.9.4.el_capitan.bottle.tar.gz 5==> Caveats 6This formula is keg-only, which means it was not symlinked into /usr/local. 7 8macOS already provides this software and installing another version in 9parallel can cause all kinds of trouble. 10 11Generally there are no consequences of this for you. If you build your 12own software and it requires this formula, you'll need to add to your 13build variables: 14 15 LDFLAGS: -L/usr/local/opt/libxml2/lib 16 CPPFLAGS: -I/usr/local/opt/libxml2/include 17 18==> Summary 19???? /usr/local/Cellar/libxml2/2.9.4: 276 files, 9.8M

bash

1$ brew install mcrypt 2==> Downloading https://homebrew.bintray.com/bottles/mcrypt-2.6.8.el_capitan.bottle.1.tar.gz 3Already downloaded: /Users/sounisi5011/Library/Caches/Homebrew/mcrypt-2.6.8.el_capitan.bottle.1.tar.gz 4==> Pouring mcrypt-2.6.8.el_capitan.bottle.1.tar.gz 5???? /usr/local/Cellar/mcrypt/2.6.8: 18 files, 396.4K

インストールしたパスを分かりやすく表示

bash

1$ echo -e "--with-openssl=$(brew --prefix openssl)\n--with-libxml-dir=$(brew --prefix libxml2)\n--with-mcrypt=$(brew --prefix mcrypt)" 2--with-openssl=/usr/local/opt/openssl 3--with-libxml-dir=/usr/local/opt/libxml2 4--with-mcrypt=/usr/local/opt/mcrypt

default_configure_optionsを編集

diff

1 --without-pear 2 --with-gd 3 --enable-sockets 4 --with-jpeg-dir=/usr 5 --with-png-dir=/usr 6 --enable-exif 7 --enable-zip 8 --with-zlib 9 --with-zlib-dir=/usr 10 --with-kerberos 11- --with-openssl 12+ --with-openssl=/usr/local/opt/openssl 13- --with-mcrypt=/usr 14+ --with-mcrypt=/usr/local/opt/mcrypt 15 --enable-soap 16 --enable-xmlreader 17 --with-xsl 18 --enable-ftp 19 --enable-cgi 20 --with-curl=/usr 21 --with-tidy 22 --with-xmlrpc 23 --enable-sysvsem 24 --enable-sysvshm 25 --enable-shmop 26 --with-mysqli=mysqlnd 27 --with-pdo-mysql=mysqlnd 28 --with-pdo-sqlite 29 --enable-pcntl 30 --with-readline 31 --enable-mbstring 32 --disable-debug 33 --enable-fpm 34 --enable-bcmath 35+ --with-libxml-dir=/usr/local/opt/libxml2 36 YACC=/usr/local/opt/bison/bin/bison

autoconfとautomakeをインストール

bash

1$ brew install autoconf 2==> Downloading https://homebrew.bintray.com/bottles/autoconf-2.69.el_capitan.bottle.4.tar.gz 3######################################################################## 100.0% 4==> Pouring autoconf-2.69.el_capitan.bottle.4.tar.gz 5==> Caveats 6Emacs Lisp files have been installed to: 7 /usr/local/share/emacs/site-lisp/autoconf 8==> Summary 9???? /usr/local/Cellar/autoconf/2.69: 70 files, 3.0M

bash

1$ brew install automake 2==> Downloading https://homebrew.bintray.com/bottles/automake-1.15.el_capitan.bottle.2.tar.gz 3######################################################################## 100.0% 4==> Pouring automake-1.15.el_capitan.bottle.2.tar.gz 5???? /usr/local/Cellar/automake/1.15: 130 files, 2.9M

PHP 7.0.7を再インストール

bash

1$ phpenv uninstall 7.0.7 2Are you sure you want to remove version ‘7.0.7’? [y/N]: y 3Version ‘7.0.7’ (/Users/sounisi5011/.anyenv/envs/phpenv/versions/7.0.7) successfully removed.

bash

1$ phpenv install 7.0.7 2[Info]: Loaded extension plugin 3[Info]: Loaded apc Plugin. 4[Info]: Loaded composer Plugin. 5[Info]: Loaded github Plugin. 6[Info]: Loaded uprofiler Plugin. 7[Info]: Loaded xdebug Plugin. 8[Info]: Loaded xhprof Plugin. 9[Info]: php.ini-production gets used as php.ini 10[Info]: Building 7.0.7 into /Users/sounisi5011/.anyenv/envs/phpenv/versions/7.0.7 11[Skipping]: Already downloaded and extracted https://secure.php.net/distributions/php-7.0.7.tar.bz2 12[Preparing]: /var/tmp/php-build/source/7.0.7 13[Compiling]: /var/tmp/php-build/source/7.0.7 14[xdebug]: Installing version 2.4.1 15[xdebug]: Compiling xdebug in /var/tmp/php-build/source/xdebug-2.4.1 16[xdebug]: Installing xdebug configuration in /Users/sounisi5011/.anyenv/envs/phpenv/versions/7.0.7/etc/conf.d/xdebug.ini 17[xdebug]: Cleaning up. 18[Info]: Enabling Opcache... 19[Info]: Done 20[Info]: The Log File is not empty, but the Build did not fail. Maybe just warnings got logged. You can review the log in /tmp/php-build.7.0.7.20161013155357.log 21[Success]: Built 7.0.7 successfully.

成功!

投稿2016/10/13 14:29

sounisi5011

総合スコア697

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問