gpt4 book ai didi

terminal - 在mac php7.2 MAMP上安装mcrypt

转载 作者:行者123 更新时间:2023-12-02 18:59:33 26 4
gpt4 key购买 nike

我尝试遵循此处有关堆栈溢出的大部分教程,但没有成功。

Issue in installing php7.2-mcrypt

https://github.com/tamtamnl/valet-plus/tree/hotfix/homebrew-core-php

https://github.com/weprovide/valet-plus/issues/127

https://github.com/Homebrew/homebrew-core/issues/26082

Enable MCrypt using MAMP

Laravel requires the Mcrypt PHP extension

<小时/>

Error 1 : Check Image Here

<小时/>

Here's my PHP Version on MAMP

<小时/>

这是我在终端上检查版本时得到的结果

AVMBP:~ AV$ php -v
PHP 5.6.33 (cli) (built: Feb 1 2018 13:59:05)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.5.3, Copyright (c) 2002-2017, by Derick Rethans

<小时/>

当我尝试在终端上安装 mcrypt 时,这就是我得到的结果

AVsMBP:~ AV$  sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo: apt-get: command not found

我尝试了以下步骤

brew install mcrypt

这是我得到的

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
youtube-dl

Warning: mcrypt 2.6.8 is already installed and up-to-date
To reinstall 2.6.8, run `brew reinstall mcrypt`

AVs-Macbook-Pro:~ AV$ brew reinstall mcrypt
==> Reinstalling mcrypt
==> Downloading https://homebrew.bintray.com/bottles/mcrypt-2.6.8.yosemite.bottl
Already downloaded: /Users/AV/Library/Caches/Homebrew/mcrypt-2.6.8.yosemite.bottle.1.tar.gz
==> Pouring mcrypt-2.6.8.yosemite.bottle.1.tar.gz
🍺 /usr/local/Cellar/mcrypt/2.6.8: 18 files, 396.7KB
AVs-Macbook-Pro:~ AV$

然后,我检查是否安装了 mcrypt

brew search mcrypt

这是我得到的

AVs-Macbook-Pro:~ AV$ brew search mcrypt
==> Searching local taps...

mcrypt ✔ libtomcrypt
==> Searching taps on GitHub...
==> Searching blacklisted, migrated and deleted formulae...

通过终端成功安装 mcrypt 后,我​​将 mcrypt.so 扩展添加到 php.ini 中。

/Applications/MAMP/bin/php/php7.2.1/conf/php.ini

extension=mcrypt.so

我验证了扩展程序是否已安装,我得到了这个;

AVs-Macbook-Pro:~ AV$ php -i | grep "mcrypt"
Configure Command => './configure' '--prefix=/usr/local/php5' '--with-apxs2=/usr/sbin/apxs' '--with-config-file-scan-dir=/usr/local/php5/php.d' '--with-libxml-dir=shared,/usr' '--with-openssl=/usr/local/php5' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--with-gd' '--with-ldap' '--with-xmlrpc' '--enable-exif' '--enable-soap' '--enable-wddx' '--enable-ftp' '--with-iodbc' '--enable-sockets' '--with-bz2=/usr' '--enable-zip' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-mbstring' '--enable-bcmath' '--enable-calendar' '--with-mhash' '--enable-fpm' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-pcntl' '--enable-dtrace' '--enable-opcache' '--with-icu-dir=/usr/local/php5' '--with-mssql=shared,/usr/local/php5' '--with-pdo-dblib=shared,/usr/local/php5' '--with-xsl=shared,/usr/local/php5' '--with-imap=shared,../imap-2007f' '--with-kerberos=/usr' '--with-imap-ssl=/usr/local/php5' '--with-gettext=/usr/local/php5' '--with-curl=shared,/usr/local/php5' '--with-png-dir=/usr/local/php5' '--with-jpeg-dir=/usr/local/php5' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/local/php5' '--with-pgsql=shared,/usr/local/php5' '--with-pdo-pgsql=shared,/usr/local/php5' '--with-mcrypt=shared,/usr/local/php5' '--with-tidy=/usr/local/php5' '--with-gmp=shared,/usr/local/php5' '--with-readline=shared,/usr/local/php5' '--with-libxml-dir=/usr/local/php5' 'CC=cc '-L/usr/local/php5/lib' '-I/usr/local/php5/include' '-I/usr/include/libxml2' '-I/usr/local/php5/include/tidy' '-DENTROPY_CH_RELEASE=1'' 'CFLAGS=-Os '-mmacosx-version-min=10.10' '-I/usr/local/php5/include' '-arch' '-no-cpp-precomp' '-DENTROPY_CH_ARCHS='''i386/x86_64'''' '-DENTROPY_CH_RELEASE=1'' 'LDFLAGS=-L/usr/local/php5/lib '-arch' 'CXXFLAGS=-arch
/usr/local/php5/php.d/50-extension-mcrypt.ini,
Registered Stream Filters => zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*, http.*
mcrypt
mcrypt support => enabled
mcrypt_filter support => enabled
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value
AVs-Macbook-Pro:~ AV$

重新启动系统,当我运行我的php系统时仍然出现此错误

An Error Was Encountered
The Encrypt library requires the Mcrypt extension.

请帮助我。预先感谢!

最佳答案

如果您没有正确安装 mcrypt 库,请尝试以下操作:

https://gist.github.com/idleberg/24479f34dc5007e50d47

或参见 http://www.php.net/manual/en/mcrypt.setup.php了解其他信息。

如果您使用共享主机,您可以要求您的提供商安装它。

<小时/>

在 OSX 本地主机中,您可以通过自制软件轻松安装 mcrypt - 正如您在上面尝试过的:

brew install mcrypt

然后将此行添加到您的 php.ini 文件中。您可以从上面的自制输出中看到:“/usr/local/Cellar/mcrypt/2.6.8”

extension="/usr/local/Cellar/mcrypt/2.6.8/mcrypt.so"

不要忘记重新启动服务器以使编辑生效

关于terminal - 在mac php7.2 MAMP上安装mcrypt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50673429/

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