zha*_*ngv 7 php macos homebrew mcrypt
操作系统:macOS 11 (big sur)
自制软件:2.5.12
梨版本:1.10.12
我刚刚使用自制软件(brew install php@7.4)将我的 mac 上的 php 从 php7.1 升级到 php7.4。
然后,当我尝试安装 mcrypt 扩展时,出现错误:
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
ERROR: `/private/tmp/pear/install/mcrypt/configure --with-php-config=/usr/local/homebrew/opt/php@7.4/bin/php-config --with-mcrypt' failed
Run Code Online (Sandbox Code Playgroud)
这是我所做的:
我试过的:
找到 mcrypt.h 并将文件手动放置到几个位置(基于 php-config),不起作用。
清理 brew 并重新安装/重新链接 mcrypt(libmcrypt),不起作用。
删除了旧 brew 版本的遗留 mcrypt 文件。
Ode*_*Wat 29
我遇到了同样的问题。所以安装 libmcrypt 之后brew install mcrypt configure 似乎无法自动解析 mcrypt.h 的路径。指定 CPPFLAGS 或提供自制程序包含路径也不起作用。
但我找到了一个适合我的解决方案,为 pecl 提供了 Homebrew Cellar 中 mcrypt 的安装位置。这是以下代码自动执行的操作:
pecl install mcrypt <<<"$(ls -d $(brew --prefix)/Cellar/mcrypt/* | tail -1)"
这里的问题是configure命令找不到homebrew安装的libmcrypt
你可以
下载mcrypt-1.0.4的源代码,然后cd到文件夹中
运行“phpize”
运行“./configure --with-mcrypt=/opt/homebrew/Cellar/mcrypt/2.6.8”,您可以使用 homebrew lib 的路径更改此处的路径
运行“make && make install”
将 extension=mcrypt.so 添加到您的配置文件中
ps:用来php -i | grep "Loaded Configuration File"定位你的php配置文件
| 归档时间: |
|
| 查看次数: |
724 次 |
| 最近记录: |