AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1751501
Accepted
lustre
lustre
Asked: 2022-11-08 01:14:58 +0800 CST2022-11-08 01:14:58 +0800 CST 2022-11-08 01:14:58 +0800 CST

我的 macOS 上有 openssl,但是当我编译 PHP 时,出现错误

  • 772

我使用这个命令在我的 macOS 上编译 php:

./configure \
  --prefix=/opt/php-7.4.30 \
  --with-config-file-path=/opt/php-7.4.30/etc \
  --with-pdo-mysql=mysqlnd \
  --with-mysqli=mysqlnd \
  --with-libxml-dir \
  --with-gd \
  --with-jpeg-dir \
  --with-png-dir \
  --with-freetype-dir \
  --with-iconv=/opt/homebrew/Cellar/libiconv/1.17 \
  --with-zlib-dir=/opt/homebrew/Cellar/zlib/1.2.12_1 \
  --with-bz2=/opt/homebrew/Cellar/bzip2/1.0.8 \
  --with-openssl=/opt/homebrew/Cellar/openssl@3/3.0.5/\
  --with-curl=/opt/homebrew/Cellar/curl/7.85.0 \
  --enable-soap \
  --enable-mbstring \
  --enable-sockets \
  --enable-exif \
  --with-readline=/opt/homebrew/Cellar/readline/8.1.2 \
  --disable-ipv6

在我的 macOS 中,我确实有/opt/homebrew/Cellar/openssl@3/3.0.5/

 % ls /opt/homebrew/Cellar/openssl@3/3.0.5/
AUTHORS         INSTALL_RECEIPT.json    NEWS            bin         lib
CHANGES         LICENSE         README          include         share

我得到以下错误:

Configuring extensions
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking for strtoll... yes
checking for atoll... yes
checking whether to build with LIBXML support... yes
checking for libxml-2.0 >= 2.7.6... yes
checking for OpenSSL support... yes
checking for Kerberos support... no
checking whether to use system default cipher list instead of hardcoded value... no
checking for openssl >= 1.0.1... no
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.

编辑-01

在问这个问题之前,我尝试过:

export OPENSSL_CFLAGS="/opt/homebrew/Cellar/openssl@3/3.0.5/include" 
export OPENSSL_LIBS="/opt/homebrew/Cellar/openssl@3/3.0.5/lib"

export PKG_CONFIG_PATH=/opt/homebrew/Cellar/openssl@3/3.0.5/lib/pkgconfig:$PKG_CONFIG_PATH
macos
  • 1 1 个回答
  • 16 Views

1 个回答

  • Voted
  1. Best Answer
    harrymc
    2022-11-08T01:52:39+08:002022-11-08T01:52:39+08:00

    此错误报告处理问题 所有最新版本都无法在 OSX 10.14 Mojave #90 上构建/安装:

    为了让 PHP 7.1.32 在 Mojave 上构建,我需要这个配置:

    env PATH="$(brew --prefix icu4c)/sbin:$(brew --prefix libiconv)/bin:$(brew --prefix curl)/bin:$(brew --prefix
    

    libxml2)/bin:$(brew --prefix bzip2)/bin:$(brew --prefix bison)/bin:$PATH" CONFIGURE_OPTS="--with-zlib-dir=$(brew --prefix zlib) - -with-bz2=$(brew --prefix bzip2) --with-curl=$(brew --prefix curl) --with-iconv=$(brew --prefix libiconv)" PHP_BUILD_CONFIGURE_OPTS="--with-openssl =$(brew --prefix [email protected])" phpenv 安装 7.1.32

    那是安装了 [email protected] 而未安装 openssl@3。我还需要修补配置,如 https://bbs.archlinux.org/viewtopic.php?pid=1954966#p1954966所述,否则构建失败:

    /var/tmp/php-build/source/7.1.32/ext/intl/collat​​or/collat​​or_sort.c:543:26:错误:使用未声明的标识符'FALSE' collat​​or_sort_internal(FALSE,INTERNAL_FUNCTION_PARAM_PASSTHRU);这是补丁:

    diff --git a/configure b/configure
    index 78811fa..5a303a0 100755
    --- a/configure
    +++ b/configure
    @@ -45864,7 +45864,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
         php_cxx_done=yes
       fi
     
    -  INTL_COMMON_FLAGS="$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
    +  INTL_COMMON_FLAGS="$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DU_DEFINE_FALSE_AND_TRUE=1"
       if test "$icu_version" -ge "4002"; then
         icu_spoof_src=" spoofchecker/spoofchecker_class.c \
         spoofchecker/spoofchecker.c\
    

    在 MacOS Catalina #100 上安装 7.4.7 版本的问题中也处理了同样的问题 ,发帖人宁愿选择使用 phpbrew.

    • 0

相关问题

  • 如何使用键盘快捷键在 macOS 终端中选择一行?

  • weechat, tig, htop, ranger等没有颜色

  • 如何在 macOS 的终端中切换切换(连续性)?

  • 如何强制chrome在macos中使用pac文件?

  • “npm config set prefix”在 macOS Mojave 中的用户拥有的目录上失败

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    v15 为什么通过电缆(同轴电缆)的千兆位/秒 Internet 连接不能像光纤一样提供对称速度? 2020-01-25 08:53:31 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve