简体   繁体   English

将OSX更新为“El Capitan”后未定义的函数mcrypt

[英]Undefined function mcrypt after update OSX to “El Capitan”

I have a problem with mcrypt extension after update "Yosemite" to "El Capitan". 将“Yosemite”更新为“El Capitan”后,我遇到了mcrypt扩展问题。

Fatal error: Call to undefined function mcrypt_decrypt() in /Users/Pilipe/Sites/prestashop-test/classes/Rijndael.php on line 68 致命错误:在第68行的/Users/Pilipe/Sites/prestashop-test/classes/Rijndael.php中调用未定义的函数mcrypt_decrypt()

In my php.ini, I added this line : 在我的php.ini中,我添加了这一行:

extension="/usr/local/Cellar/php56-mcrypt/5.6.13/mcrypt.so" 扩展= “/ USR /本地/地窖/ php56-mcrypt的/ 5.6.13 / mcrypt.so”

When I launch this command line : 当我启动此命令行时:

php -i | php -i | grep 'mcrypt' grep'mcrypt'

I have : 我有 :

Additional .ini files parsed => /usr/local/etc/php/5.6/conf.d/ext-mcrypt.ini 解析了其他.ini文件=> /usr/local/etc/php/5.6/conf.d/ext-mcrypt.ini
Registered Stream Filters => zlib. 已注册的流过滤器=> zlib。 , bzip2. ,bzip2。 , convert.iconv. ,convert.iconv。 , string.rot13, string.toupper, string.tolower, string.strip_tags, convert. ,string.rot13,string.toupper,string.tolower,string.strip_tags,convert。 , consumed, dechunk, mcrypt. 消费,消遣,mcrypt。 , mdecrypt. ,mdecrypt。
PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. PHP警告:未知:依赖系统的时区设置是不安全的。 You are required to use the date.timezone setting or the date_default_timezone_set() function. 需要使用date.timezone设置或date_default_timezone_set()函数。 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. 我们现在选择了时区'UTC',但请设置date.timezone以选择您的时区。 in Unknown on line 0 在第0行的未知中
mcrypt mcrypt的
mcrypt support => enabled mcrypt support =>启用
mcrypt_filter support => enabled mcrypt_filter support =>已启用
mcrypt.algorithms_dir => no value => no value mcrypt.algorithms_dir =>没有值=>没有价值
mcrypt.modes_dir => no value => no value mcrypt.modes_dir =>没有值=>没有值
PWD => /usr/local/Cellar/php56-mcrypt/5.6.13 PWD => /usr/local/Cellar/php56-mcrypt/5.6.13
_SERVER["PWD"] => /usr/local/Cellar/php56-mcrypt/5.6.13 _SERVER [“PWD”] => /usr/local/Cellar/php56-mcrypt/5.6.13

Command php -v : 命令php -v:

PHP 5.6.13 (cli) (built: Oct 2 2015 23:07:16) PHP 5.6.13(cli)(建于2015年10月2日23:07:16)
Copyright (c) 1997-2015 The PHP Group 版权所有(c)1997-2015 PHP小组
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies Zend Engine v2.6.0,版权所有(c)1998-2015 Zend Technologies

I installed mcrypt with : 我安装了mcrypt:

brew install php56-mcrypt brew安装php56-mcrypt

I did that : 我这样做了:

brew link php56-mcrypt brew链接php56-mcrypt

why mcrypt it not working ? 为什么mcrypt它无法正常工作?

Thank you in advance. 先感谢您。
Sincerely Philippe. 真诚的菲利普。

I was able to resolve this by uninstalling Homebrew, reinstalling Homebrew and then installing the php 5.6 mcrypt package. 我能够通过卸载Homebrew,重新安装Homebrew然后安装php 5.6 mcrypt包来解决这个问题。 The advantage of this method over Pilipe's solution is it doesn't require disabling the new System Integrity Protection (SIP). 这种方法优于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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM