macos - 产生 1 个错误。 make : *** [php_intl. lo] Error 1 ERROR: `make' failed

标签 macos homebrew pecl intl

我在我的 macbook pro 上安装了 php 7.3.4,我正在尝试启用 composer 需要的 php 扩展 (intl)。我在 php.ini 中启用了扩展名 intl,但我收到一条错误消息说找不到它 - 所以我假设这意味着我需要安装它。我在网上找到了一个关于如何安装扩展的教程(链接在底部),然后我就按照这个做了。 在我运行 sudo pecl install intl 的阶段,我收到一个错误; make: *** [php_intl.lo] 错误 1 错误:`make' 失败

有没有人有解决办法?

Jamess-MBP:~ work$ sudo pecl install intl
Password: .........
PHP Warning:  PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/local/lib/php/pecl/20180731/intl (dlopen(/usr/local/lib/php/pecl/20180731/intl, 9): image not found), /usr/local/lib/php/pecl/20180731/intl.so (dlopen(/usr/local/lib/php/pecl/20180731/intl.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/local/lib/php/pecl/20180731/intl (dlopen(/usr/local/lib/php/pecl/20180731/intl, 9): image not found), /usr/local/lib/php/pecl/20180731/intl.so (dlopen(/usr/local/lib/php/pecl/20180731/intl.so, 9): image not found)) in Unknown on line 0
downloading intl-3.0.0.tgz ...
Starting to download intl-3.0.0.tgz (248,200 bytes)
....................................................done: 248,200 bytes
150 source files, building
running: phpize
Configuring for:
PHP Api Version:         20180731
Zend Module Api No:      20180731
Zend Extension Api No:   320180731
Specify where ICU libraries and headers can be found [DEFAULT] : /usr/local/Cellar/icu4c/63.1/
building in /private/tmp/pear/temp/pear-build-rootf9ZgsV/intl-3.0.0
running: /private/tmp/pear/temp/intl/configure --with-php-config=/usr/local/Cellar/php/7.3.4/bin/php-config --with-icu-dir=/usr/local/Cellar/icu4c/63.1/
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-apple-darwin17.7.0
checking host system type... x86_64-apple-darwin17.7.0
checking target system type... x86_64-apple-darwin17.7.0
checking for PHP prefix... /usr/local/Cellar/php/7.3.4
checking for PHP includes... -I/usr/local/Cellar/php/7.3.4/include/php -I/usr/local/Cellar/php/7.3.4/include/php/main -I/usr/local/Cellar/php/7.3.4/include/php/TSRM -I/usr/local/Cellar/php/7.3.4/include/php/Zend -I/usr/local/Cellar/php/7.3.4/include/php/ext -I/usr/local/Cellar/php/7.3.4/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/Cellar/php/7.3.4/pecl/20180731
checking for PHP installed headers prefix... /usr/local/Cellar/php/7.3.4/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable internationalization support... yes, shared
checking for location of ICU headers and libraries... checking for pkg-config... /usr/local/bin/pkg-config
/usr/local/Cellar/icu4c/63.1
checking for ICU 4.0 or greater... found 63.1
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by cc... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin17.7.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common
checking if g++ PIC flag -fno-common works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin17.7.0 dyld
(cached) (cached) checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /private/tmp/pear/temp/pear-build-rootf9ZgsV/intl-3.0.0/libtool --mode=compile cc -I/usr/local/Cellar/icu4c/63.1/include  -Wno-write-strings -I. -I/private/tmp/pear/temp/intl -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootf9ZgsV/intl-3.0.0/include -I/private/tmp/pear/temp/pear-build-rootf9ZgsV/intl-3.0.0/main -I/private/tmp/pear/temp/intl -I/usr/local/Cellar/php/7.3.4/include/php -I/usr/local/Cellar/php/7.3.4/include/php/main -I/usr/local/Cellar/php/7.3.4/include/php/TSRM -I/usr/local/Cellar/php/7.3.4/include/php/Zend -I/usr/local/Cellar/php/7.3.4/include/php/ext -I/usr/local/Cellar/php/7.3.4/include/php/ext/date/lib -I/usr/local/Cellar/icu4c/63.1/include  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/temp/intl/php_intl.c -o php_intl.lo
mkdir .libs
 cc -I/usr/local/Cellar/icu4c/63.1/include -Wno-write-strings -I. -I/private/tmp/pear/temp/intl -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-rootf9ZgsV/intl-3.0.0/include -I/private/tmp/pear/temp/pear-build-rootf9ZgsV/intl-3.0.0/main -I/private/tmp/pear/temp/intl -I/usr/local/Cellar/php/7.3.4/include/php -I/usr/local/Cellar/php/7.3.4/include/php/main -I/usr/local/Cellar/php/7.3.4/include/php/TSRM -I/usr/local/Cellar/php/7.3.4/include/php/Zend -I/usr/local/Cellar/php/7.3.4/include/php/ext -I/usr/local/Cellar/php/7.3.4/include/php/ext/date/lib -I/usr/local/Cellar/icu4c/63.1/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/intl/php_intl.c  -fno-common -DPIC -o .libs/php_intl.o
In file included from /private/tmp/pear/temp/intl/php_intl.c:25:
In file included from /private/tmp/pear/temp/intl/php_intl.h:34:
/private/tmp/pear/temp/intl/intl_error.h:24:10: fatal error: 'ext/standard/php_smart_str.h' file not found
#include <ext/standard/php_smart_str.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [php_intl.lo] Error 1
ERROR: `make' failed

我按照在线教程进入了这个阶段,这是 http://budiirawan.com/install-php-intl-extension-os-x/

最佳答案

请按照流程(来自https://medium.com/@agaetis/solved-install-intl-php-extension-for-xampp-and-magento-for-macos-mojave-41fa42336fc6)

安装 intl.so 的步骤:正确的 intl 随 PHP 源代码一起提供,在 PECL 中不可用。

  1. 确保安装了 Xcode 和 autoconf
  2. 从 php.net 下载 XAMPP 中使用的 PHP 版本并运行一系列命令
  3. tar -xzvf php-7.3.10.tar.gz; cd php-7.3.10/ext/intl
  4. /Applications/XAMPP/bin/phpize
  5. ./configure --enable-intl --with-php-config=/Applications/XAMPP/bin/php-config --with-icu-dir=/Applications/XAMPP/xamppfiles/
  6. 制作
  7. sudo make install

在 php.ini (/Applications/XAMPP/xamppfiles/etc/php.ini) 中添加以下行 extension=intl.so

关于macos - 产生 1 个错误。 make : *** [php_intl. lo] Error 1 ERROR: `make' failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55735654/

相关文章:

html - Mac os 上有什么强大的html 编辑器吗?

macos - mac 无法远程访问 Jenkins 网页

vagrant puphpet Composer 创建项目不起作用

php - 如何安装 Pecl Phar? (得到错误)

macos - 避免 Mac OS 上的 SSH 超时?

macos - 在 localhost 上启动 Jupyter Notebook 会导致 '[Errno 49] Can' t 分配请求的地址,但是 ip=127.0.0.1 有效

c++ - boost :未知类型名称 'reference_type_of_temporary_wrapper'

python - 在 Mac OS X 上安装 pygtk 的最简单方法

bash - brew 医生说 "Error:/usr/bin occurs before/usr/local/bin"如何修复?

php - 无法从 pecl 网站下载 php_mongodb.dll