Php Mamp pro上的Magento 2需要ext mcrypt
我正在尝试在我的MAMP PRO上安装,但我从composer收到以下错误:Php Mamp pro上的Magento 2需要ext mcrypt,php,magento,composer-php,mamp,Php,Magento,Composer Php,Mamp,我正在尝试在我的MAMP PRO上安装,但我从composer收到以下错误: *Your requirements could not be resolved to an installable set of packages. Problem 1 - magento/framework 100.0.4 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
*Your requirements could not be resolved to an installable set of packages.
Problem 1
- magento/framework 100.0.4 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- magento/framework 100.0.4 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- Installation request for magento/framework 100.0.4 -> satisfiable by magento/framework[100.0.4].*
但mcrypt安装在我的MAMP中:
我尝试将php版本添加到.bash\u profile
文件中,但未解决以下问题:
export MAMP_PHP=/Applications/MAMP/bin/php/php5.5.10/bin
export PATH="$MAMP_PHP:$PATH"
我尝试运行php-I | grep mcrypt,结果如下:
~/Sites/magento2$php-i | grep mcrypt
Configure Command=>'./Configure'--使用mysql=mysqlnd'--使用gd'--使用jpeg dir=/Applications/MAMP/Library'--使用png dir=/Applications/MAMP/Library'--使用zlib'--使用zlib dir=/Applications/MAMP/Library'--前缀=/Applications/MAMP/bin/php/php5.6.10'“--exec prefix=/Applications/MAMP/bin/php/php5.6.10”“--sysconfdir=/Applications/MAMP/bin/php/php5.6.10/conf”“--配置文件路径=/Applications/MAMP/bin/php/php5.6.10/conf”“--启用ftp”“--启用gd本机ttf”“--启用-bz2=/usr”“--启用ldap”“--启用mysqli=mysqlnd”“--启用-t1lib=/Applications/MAMP/Library”“--启用mbstring=all”“--使用curl=/Applications/MAMP/Library”“--启用套接字”“--启用bcmath”“--使用imap=shared,/Applications/MAMP/Library/lib/imap-2007f”“--启用soap”“--使用kerberos”“--启用日历”“--使用pgsql=shared,/Applications/MAMP/Library/pg”“--使用libxml dir=/Applications/MAMP/Library”“--使用gettext=shared,/Applications/MAMP/Library“”--使用xsl=/Applications/MAMP/Library“”--使用pdo mysql=mysqlnd“”--使用pdo pgsql=shared,/Applications/MAMP/Library/pg“”--使用mcrypt=shared,/Applications/MAMP/Library“”--使用openssl“”--启用zip“”--使用iconv=/Applications/MAMP/Library“”--启用opcache“”--启用cgi“”--启用intl“”--使用icu目录=/Applications/MAMP/Library“”--使用tidy=shared“”--启用wddx“”--使用libexpat目录=/Applications/MAMP/Library“”--使用readline“”CFLAGS=-arch'LDFLAGS=-arch'LIBS=-lresolv''cxflags=-arch
注册流过滤器=>zlib.,bzip2.,convert.iconv.,string.rot13,string.toupper,string.tolower,string.strip_标记,convert.,consumered,dechunk,mcrypt.,mdecrypt
在Mac上,运行MAMP:
您需要找到正在运行的php版本的php.ini文件,并替换扩展名_dir行,如下所示。(请确保将“php5.6.10”替换为您的版本,“no-debug-non-zts-20131226”替换为扩展名中的文件夹名称。)
ini文件通常位于:mamp/php/your php version/conf
extension_dir = "/Applications/MAMP/bin/php/php5.6.10/lib/php/extensions/no-debug-non-zts-20131226/"
在您的情况下,命令行PHP可能会使用不同的配置文件。试着运行
php-i | grep mcrypt
,看看它是否出现在您的CLI配置中。这个答案非常棒。
extension_dir = "/Applications/MAMP/bin/php/php5.6.10/lib/php/extensions/no-debug-non-zts-20131226/"