export PATH="/Users/(アカウント名)/.phpenv/bin:$PATH"
eval "$(phpenv init -)"
Add above line at the end of your ~/.bashrc and restart your shell to use phpenv.
% phpenv
rbenv 1.1.2-30-gc879cb0
Usage: rbenv <command> [<args>]
Some useful rbenv commands are:
commands List all available rbenv commands
local Set or show the local application-specific Ruby version
global Set or show the global Ruby version
shell Set or show the shell-specific Ruby version
rehash Rehash rbenv shims (run this after installing executables)
version Show the current Ruby version and its origin
versions List installed Ruby versions
which Display the full path to an executable
whence List all Ruby versions that contain the given executable
See `rbenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/rbenv/rbenv#readme
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables LIBXML_CFLAGS
and LIBXML_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details
-----------------------------------------
The full Log is available at '/tmp/php-build.7.4.6.20200518013139.log'.
[Warn]: Aborting build.
エラーで失敗。
こういったのが,精神的にきつい。
とりあえず,ログを参照。
% cat /tmp/php-build.7.4.6.20200518013139.log
configure: WARNING: unrecognized options: --with-png-dir, --with-icu-dir
configure: error: in `/var/tmp/php-build/source/7.4.6':
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables LIBXML_CFLAGS
and LIBXML_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
No package 'krb5-gssapi' found
No package 'krb5' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables KERBEROS_CFLAGS
and KERBEROS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
-----------------------------------------
The full Log is available at '/tmp/php-build.7.4.6.20200518015313.log'.
[Warn]: Aborting build.
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
configure: error: Package requirements (openssl >= 1.0.1) were not met:
No package 'openssl' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables OPENSSL_CFLAGS
and OPENSSL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
-----------------------------------------
The full Log is available at '/tmp/php-build.7.4.6.20200518020736.log'.
[Warn]: Aborting build.
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
No package 'krb5-gssapi' found
No package 'krb5' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables KERBEROS_CFLAGS
and KERBEROS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
-----------------------------------------
The full Log is available at '/tmp/php-build.7.4.6.20200518022506.log'.
[Warn]: Aborting build.
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
configure: error: Package requirements (openssl >= 1.0.1) were not met:
No package 'openssl' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables OPENSSL_CFLAGS
and OPENSSL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
-----------------------------------------
The full Log is available at '/tmp/php-build.7.4.6.20200518023833.log'.
[Warn]: Aborting build.
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
configure: WARNING: unrecognized options: --with-png-dir, --with-icu-dir
configure: error: Please reinstall the BZip2 distribution
-----------------------------------------
しかし,エラー内容が変わりましたね。 「BZip2 をインストールせよ」とのこと。
ちなみに,OpenSSLのパスはとくに関係ないみたいです。
% which openssl
/usr/bin/openssl
LDFLAGS,CPPFLAGS,PKG_CONFIG_PATH,これらが重要だったみたい。
とりあえず, brew で bzip2 をインストールしてみましょう。
brew で BZip2 をインストール
% brew install bzip2
bzip2 is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have bzip2 first in your PATH run:
echo 'export PATH="/usr/local/opt/bzip2/bin:$PATH"' >> ~/.zshrc
For compilers to find bzip2 you may need to set:
export LDFLAGS="-L/usr/local/opt/bzip2/lib"
export CPPFLAGS="-I/usr/local/opt/bzip2/include"
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
configure: WARNING: unrecognized options: --with-png-dir, --with-icu-dir
configure: error: Please reinstall the BZip2 distribution
-----------------------------------------
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
configure: WARNING: unrecognized options: --with-png-dir, --with-icu-dir
configure: error: Please reinstall the BZip2 distribution
-----------------------------------------
% brew install bzip2 libiconv zlib
(中略)
Warning: bzip2 1.0.8 is already installed and up-to-date
To reinstall 1.0.8, run `brew reinstall bzip2`
(中略)
libiconv is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have libiconv first in your PATH run:
echo 'export PATH="/usr/local/opt/libiconv/bin:$PATH"' >> ~/.zshrc
For compilers to find libiconv you may need to set:
export LDFLAGS="-L/usr/local/opt/libiconv/lib"
export CPPFLAGS="-I/usr/local/opt/libiconv/include"
zlib is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
For compilers to find zlib you may need to set:
export LDFLAGS="-L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include"
For pkg-config to find zlib you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/zlib/lib/pkgconfig"
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
No package 'icu-uc' found
No package 'icu-io' found
No package 'icu-i18n' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables ICU_CFLAGS
and ICU_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
-----------------------------------------
% brew reinstall icu4c
(中略)
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).
If you need to have icu4c first in your PATH run:
echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.zshrc
For compilers to find icu4c you may need to set:
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"
For pkg-config to find icu4c you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
configure: error: Package requirements (oniguruma) were not met:
No package 'oniguruma' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables ONIG_CFLAGS
and ONIG_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
-----------------------------------------
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
configure: WARNING: unrecognized options: --with-png-dir, --with-icu-dir
configure: error: Cannot find libtidy
-----------------------------------------
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
configure: error: Package requirements (libzip >= 0.11) were not met:
No package 'libzip' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables LIBZIP_CFLAGS
and LIBZIP_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
-----------------------------------------
[xdebug]: Installing version 2.9.5
[Downloading]: http://xdebug.org/files/xdebug-2.9.5.tgz
[xdebug]: Compiling xdebug in /var/tmp/php-build/source/xdebug-2.9.5
-----------------
| BUILD ERROR |
-----------------
Here are the last 10 lines from the log:
-----------------------------------------
warning: unsupported relocation in debug_info section.
note: while processing /private/var/tmp/php-build/source/7.4.6/ext/opcache/.libs/zend_accelerator_util_funcs.o
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: ext/opcache/.libs/opcache.a(shared_alloc_shm.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: ext/opcache/.libs/opcache.a(shared_alloc_shm.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: /var/tmp/php-build/source/7.4.6/modules/opcache.a(shared_alloc_shm.o) has no symbols
ld: warning: directory not found for option '-L/usr/local/opt/icu4c/lib:-L/usr/local/opt/zlib/lib:-L/usr/local/opt/libiconv/lib:-L/usr/local/opt/bzip2/lib:-L/usr/local/opt/openssl@1.1/lib:-L/usr/local/opt/krb5/lib'
ld: warning: directory not found for option '-L/usr/local/opt/icu4c/lib:-L/usr/local/opt/zlib/lib:-L/usr/local/opt/libiconv/lib:-L/usr/local/opt/bzip2/lib:-L/usr/local/opt/openssl@1.1/lib:-L/usr/local/opt/krb5/lib'
ld: warning: directory not found for option '-L/usr/local/opt/icu4c/lib:-L/usr/local/opt/zlib/lib:-L/usr/local/opt/libiconv/lib:-L/usr/local/opt/bzip2/lib:-L/usr/local/opt/openssl@1.1/lib:-L/usr/local/opt/krb5/lib'
ld: warning: directory not found for option '-L/usr/local/opt/icu4c/lib:-L/usr/local/opt/zlib/lib:-L/usr/local/opt/libiconv/lib:-L/usr/local/opt/bzip2/lib:-L/usr/local/opt/openssl@1.1/lib:-L/usr/local/opt/krb5/lib'
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
-----------------------------------------
ちょっと,意味が分からないですね。ログファイルを見ます。
configure: WARNING: unrecognized options: --with-png-dir, --with-icu-dir
configure: WARNING: unrecognized options: --with-png-dir, --with-icu-dir
ld: warning: directory not found for option '-L/usr/local/opt/icu4c/lib:-L/usr/local/opt/zlib/lib:-L/usr/local/opt/libiconv/lib:-L/usr/local/opt/bzip2/lib:-L/usr/local/opt/openssl@1.1/lib:-L/usr/local/opt/krb5/lib'
warning: unsupported relocation in debug_info section.
note: while processing /private/var/tmp/php-build/source/7.4.6/ext/opcache/.libs/zend_accelerator_util_funcs.o
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: ext/opcache/.libs/opcache.a(shared_alloc_shm.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: ext/opcache/.libs/opcache.a(shared_alloc_shm.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: /var/tmp/php-build/source/7.4.6/modules/opcache.a(shared_alloc_shm.o) has no symbols
ld: warning: directory not found for option '-L/usr/local/opt/icu4c/lib:-L/usr/local/opt/zlib/lib:-L/usr/local/opt/libiconv/lib:-L/usr/local/opt/bzip2/lib:-L/usr/local/opt/openssl@1.1/lib:-L/usr/local/opt/krb5/lib'
ld: warning: directory not found for option '-L/usr/local/opt/icu4c/lib:-L/usr/local/opt/zlib/lib:-L/usr/local/opt/libiconv/lib:-L/usr/local/opt/bzip2/lib:-L/usr/local/opt/openssl@1.1/lib:-L/usr/local/opt/krb5/lib'
ld: warning: directory not found for option '-L/usr/local/opt/icu4c/lib:-L/usr/local/opt/zlib/lib:-L/usr/local/opt/libiconv/lib:-L/usr/local/opt/bzip2/lib:-L/usr/local/opt/openssl@1.1/lib:-L/usr/local/opt/krb5/lib'
ld: warning: directory not found for option '-L/usr/local/opt/icu4c/lib:-L/usr/local/opt/zlib/lib:-L/usr/local/opt/libiconv/lib:-L/usr/local/opt/bzip2/lib:-L/usr/local/opt/openssl@1.1/lib:-L/usr/local/opt/krb5/lib'
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
brew で libxml2 をインストールする
いままで,エラーメッセージにはなかったけれど,もしかしてこれが原因なのだろうか。
% brew install libxml2
(中略)
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BSD libedit.
For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
For pkg-config to find readline you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have sqlite first in your PATH run:
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc
For compilers to find sqlite you may need to set:
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"
For pkg-config to find sqlite you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig"
Python has been installed as
/usr/local/opt/python@3.8/bin/python3
You can install Python packages with
/usr/local/opt/python@3.8/bin/pip3 install <package>
They will install into the site-package directory
/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages
See: https://docs.brew.sh/Homebrew-and-Python
python@3.8 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have python@3.8 first in your PATH run:
echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.zshrc
For compilers to find python@3.8 you may need to set:
export LDFLAGS="-L/usr/local/opt/python@3.8/lib"
For pkg-config to find python@3.8 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/python@3.8/lib/pkgconfig"
libxml2 is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have libxml2 first in your PATH run:
echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.zshrc
For compilers to find libxml2 you may need to set:
export LDFLAGS="-L/usr/local/opt/libxml2/lib"
export CPPFLAGS="-I/usr/local/opt/libxml2/include"
For pkg-config to find libxml2 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BSD libedit.
For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
For pkg-config to find readline you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have sqlite first in your PATH run:
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc
For compilers to find sqlite you may need to set:
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"
For pkg-config to find sqlite you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig"
Python has been installed as
/usr/local/opt/python@3.8/bin/python3
You can install Python packages with
/usr/local/opt/python@3.8/bin/pip3 install <package>
They will install into the site-package directory
/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages
See: https://docs.brew.sh/Homebrew-and-Python
python@3.8 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have python@3.8 first in your PATH run:
echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.zshrc
For compilers to find python@3.8 you may need to set:
export LDFLAGS="-L/usr/local/opt/python@3.8/lib"
For pkg-config to find python@3.8 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/python@3.8/lib/pkgconfig"
libxml2 is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have libxml2 first in your PATH run:
echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.zshrc
For compilers to find libxml2 you may need to set:
export LDFLAGS="-L/usr/local/opt/libxml2/lib"
export CPPFLAGS="-I/usr/local/opt/libxml2/include"
For pkg-config to find libxml2 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"
[Preparing]: /var/tmp/php-build/source/7.4.6_debug
[Compiling]: /var/tmp/php-build/source/7.4.6_debug
[Info]: Enabling Opcache...
[Info]: Done
[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.4.6_debug.20200518053236.log or rebuild with '--verbose' option
[Success]: Built 7.4.6_debug successfully.
[Preparing]: /var/tmp/php-build/source/7.4.6
[Compiling]: /var/tmp/php-build/source/7.4.6
[xdebug]: Installing version 2.9.5
[Skipping]: Already downloaded http://xdebug.org/files/xdebug-2.9.5.tgz
[xdebug]: Compiling xdebug in /var/tmp/php-build/source/xdebug-2.9.5
[xdebug]: Installing xdebug configuration in ~/.phpenv/versions/7.4.6/etc/conf.d/xdebug.ini
[xdebug]: Cleaning up.
[Info]: Enabling Opcache...
[Info]: Done
[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.4.6.20200518064609.log or rebuild with '--verbose' option
[Success]: Built 7.4.6 successfully.
% php -v
PHP 7.4.6 (cli) (built: May 18 2020 06:57:30) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.6, Copyright (c), by Zend Technologies
with Xdebug v2.9.5, Copyright (c) 2002-2020, by Derick Rethans