• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

mac1011 php报错 Use of undefined constant MCRYPT_RIJNDAEL_128

php 搞代码 3年前 (2022-01-23) 19次浏览 已收录 0个评论

错误的原因是没有安装php的mcrypt扩展,却用到了扩展里定义的加密方式的常量

解决办法:安装mcrypt扩展

具体步骤:

1、打开命令行 安装mcrypt :brew install mcrypt

2、安装php-mcrypt扩展: brew install php55-mcrypt(安装自己的php对应的版本)

中间如果遇到错误,静下心来,认真读一下英文代码,都能解决

3、看一下扩展是否已经装好

php -m | grep mcrypt

php -i | grep mcrypt

4、复制mcrypt的配置到php扫描配置的目录

默认为–with-config-file-scan-dir=/Libr%本文来源gaodai#ma#com搞*代#码9网#搞gaodaima代码ary/Server/Web/Config/php’ 可以在phpinfo中Configure Command选项中找到

接下来把mcrypt的ini文件复制进去即可:

sudo mkdir -p /Library/Server/Web/Config/php

sudo cp /usr/local/etc/php/5.5/conf.d/ext-mcrypt.ini /Library/Server/Web/Config/php/ext-mcrypt.ini

或者

sudo ln -s /usr/local/etc/php/5.5/conf.d/ext-mcrypt.ini /Library/Server/Web/Config/php/ext-mcrypt.ini

最后:sudo apachectl restart即可

你也可以使用另一种方法安装:

http://jingyan.baidu.com/article/e3c78d644cf1ed3c4c85f5a8.html

以上就介绍了mac1011 php报错 Use of undefined constant MCRYPT_RIJNDAEL_128,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:mac1011 php报错 Use of undefined constant MCRYPT_RIJNDAEL_128

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址