gpt4 book ai didi

php - 将 OSX 更新为 "El Capitan"后未定义函数 mcrypt

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:47:04 24 4
gpt4 key购买 nike

将“Yosemite”更新为“El Capitan”后,我遇到了 mcrypt 扩展的问题。

Fatal error: Call to undefined function mcrypt_decrypt() in /Users/Pilipe/Sites/prestashop-test/classes/Rijndael.php on line 68

在我的 php.ini 中,我添加了这一行:

extension="/usr/local/Cellar/php56-mcrypt/5.6.13/mcrypt.so"

当我启动这个命令行时:

php -i | grep 'mcrypt'

我有:

Additional .ini files parsed => /usr/local/etc/php/5.6/conf.d/ext-mcrypt.ini
Registered Stream Filters => zlib., bzip2., convert.iconv., string.rot13, string.toupper, string.tolower, string.strip_tags, convert., consumed, dechunk, mcrypt., mdecrypt.
PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
mcrypt
mcrypt support => enabled
mcrypt_filter support => enabled
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value
PWD => /usr/local/Cellar/php56-mcrypt/5.6.13
_SERVER["PWD"] => /usr/local/Cellar/php56-mcrypt/5.6.13

命令 php -v :

PHP 5.6.13 (cli) (built: Oct 2 2015 23:07:16)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

我安装了 mcrypt :

brew install php56-mcrypt

我这样做了:

brew link php56-mcrypt

为什么 mcrypt 不起作用?

提前致谢。
真诚的菲利普。

最佳答案

我能够通过卸载 Homebrew、重新安装 Homebrew 然后安装 php 5.6 mcrypt 包来解决这个问题。与 Pilipe 的解决方案相比,此方法的优势在于它不需要禁用新的系统完整性保护 (SIP)。

// Uninstall Homebrew
[sudo] rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup

// Reinstall Homebrea
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

// Install mcrypt
brew install php53-mcrypt

// Test mcrypt
mcrypt -v
// should result in
// Mcrypt v.0.9.9 (i386-apple-darwin15.0.0)
// Linked against libmcrypt v.2.5.8
// Copyright (C) 1998-2002 Nikos Mavroyanopoulos (nmav@gnutls.org)

关于php - 将 OSX 更新为 "El Capitan"后未定义函数 mcrypt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32916436/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com