1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

php-build on macOS Sierraのエラー例

Last updated at Posted at 2017-03-12

macOS Sierraで phpenv install 7.1.2 したら見慣れないエラーでしばらく格闘してしまったので備忘録

おまじない

brew install openssl libxml2 autoconf automake libjpeg libpng libmcrypt
export PHP_BUILD_CONFIGURE_OPTS=--with-openssl=/usr/local/opt/openssl --with-libxml-dir=/usr/local/opt/libxml2
export PHP_BUILD_EXTRA_MAKE_ARGUMENTS=-j4

Homebrewのopenssl、libxml2を参照するようにconfigureオプションを修正しておく


エラー
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive member: ext/opcache/.libs/opcache.a(libssl.a) fat file for cputype (7) cpusubtype (3) is not an object file (bad magic number)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar: internal ranlib command failed
make: *** [ext/opcache/opcache.la] Error 1
make: *** Waiting for unfinished jobs....
エラー(末尾)
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/signal.h:103:39: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
void    psignal(unsigned int, const char *);
                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/signal.h:106:31: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
int     sigvec(int, struct sigvec *, struct sigvec *);
                                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/signal.h:106:48: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
int     sigvec(int, struct sigvec *, struct sigvec *);
                                                   ^
346 warnings generated.

→Homebrewのopensslを--universalオプション付きでインストールしている
無印で再インストール

コマンド
brew uninstall --ignore-dependencies openssl
brew install openssl

エラー
configure: error: cannot find sources (README.GIT-RULES) in . or ..

→ソースコードが不完全
キャッシュディレクトリを削除してDLから再試行する
[Preparing]: で始まる行のパスを削除

コマンド
rm -rf /var/folders/z0/q7xv_xd91kx44v_cnmn4yd780000gn/T/php-build/source/5.6.30

エラー
configure: error: in `/var/folders/z0/q7xv_xd91kx44v_cnmn4yd780000gn/T/php-build/source/7.1.2':
configure: error: C compiler cannot create executables
See `config.log' for more details

→brewのopensslが破損している

コマンド
brew reinstall openssl

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?