简体   繁体   English

要启用扩展,请验证它们是否在这些 .ini 文件中启用 - Vagrant/Ubuntu/Magento 2.0.2

[英]To enable extensions, verify that they are enabled in those .ini files - Vagrant/Ubuntu/Magento 2.0.2

When installing Magento 2.0.2 via composer getting this error:通过 Composer 安装 Magento 2.0.2 时出现此错误:

Problem 1
 - Installation request for magento/product-enterprise-edition 2.0.2 -> satisfiable by magento/product-enterprise-edition[2.0.2].
 - magento/product-enterprise-edition 2.0.2 requires ext-gd * -> the requested PHP extension gd is missing from your system.

To enable extensions, verify that they are enabled in those .ini files:

- /etc/php5/cli/php.ini
- /etc/php5/cli/conf.d/05-opcache.ini
- /etc/php5/cli/conf.d/10-pdo.ini
- /etc/php5/cli/conf.d/20-curl.ini
- /etc/php5/cli/conf.d/20-imap.ini
- /etc/php5/cli/conf.d/20-json.ini
- /etc/php5/cli/conf.d/20-mcrypt.ini
- /etc/php5/cli/conf.d/20-pdo_pgsql.ini
- /etc/php5/cli/conf.d/20-pgsql.ini
- /etc/php5/cli/conf.d/20-pspell.ini
- /etc/php5/cli/conf.d/20-readline.ini

You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

I have installed php5-cli, php5-curl.我已经安装了 php5-cli、php5-curl。

First installed sudo apt-get install php5-gd , then sudo apt-get install php5-intl and last one was sudo apt-get install php5-xsl .首先安装sudo apt-get install php5-gd ,然后sudo apt-get install php5-intl ,最后一个是sudo apt-get install php5-xsl After that, it's installing as it should.之后,它应该安装。

This solved my issues这解决了我的问题

sudo apt-get install php7.1-xml

or newer version (* = your php version )或更新版本(* = 您的 php 版本)

sudo apt-get install php7.*-xml

试了很多次,上面的答案没有解决我的问题,但是这个命令帮助了我:

sudo apt-get install php-mbstring

ubuntu users try this ubuntu 用户试试这个

apt-get install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-gd php7.2-mysql php7.2-curl php7.2-intl php7.2-xsl php7.2-mbstring php7.2-zip php7.2-bcmath php7.2-soap php-xdebug php-imagick

this is work for php 7.2 but you can change this 7.2 to 5.2 and run this command it is work.这适用于 php 7.2,但您可以将此 7.2 更改为 5.2 并运行此命令,它可以工作。

When I went to create a laravel project, I got this problem.当我去创建一个laravel项目时,我遇到了这个问题。

After googling, I got this solution.谷歌搜索后,我得到了这个解决方案。

I followed these steps:我按照以下步骤操作:

Step 1: sudo apt-get install -y php7.2-gd第 1 步: sudo apt-get install -y php7.2-gd

Step 2: sudo apt-get install php7.2-intl第二步: sudo apt-get install php7.2-intl

Step 3: sudo apt-get install php7.2-xsl第 3 步: sudo apt-get install php7.2-xsl

Step 4: sudo apt-get install php7.2-mbstring第 4 步: sudo apt-get install php7.2-mbstring

这个命令可以解决问题

sudo apt-get install php5-curl

First installed首先安装

sudo apt-get install php5-gd

then然后

sudo apt-get install php5-intl

and last one was最后一个是

sudo apt-get install php5-xsl

After that, it is installing as it should.之后,它正在安装。

@Verse answer works fine. @Verse 答案工作正常。 But there is a small thing I would like to add.但是我想补充一点。 instead of installing php5-mbstring , php5-gd , php5-intl , php5-xsl .而不是安装php5-mbstringphp5-gdphp5-intlphp5-xsl This answer is based on @Regolith answer: Package has no installation candidate .此答案基于 @Regolith 答案: Package has no installationCandidate

Install according to your php-version .根据您的php-version安装。

First check which php version you have by sudo php -v.首先通过 sudo php -v 检查您的 php 版本。 I have php7 so the result is:我有 php7 所以结果是:

PHP 7.0.28-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
   with Zend OPcache v7.0.28-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

since i have php7, I will do the following to list the php packages:由于我有 php7,我将执行以下操作来列出 php 包:
sudo apt-cache search php7-*

this returned这回来了

libapache2-mod-php7.0 - server-side, HTML-embedded scripting language (Apache 2 module)
php-all-dev - package depending on all supported PHP development packages
php7.0 - server-side, HTML-embedded scripting language (metapackage)
php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary)
php7.0-cli - command-line interpreter for the PHP scripting language
php7.0-common - documentation, examples and common module for PHP
php7.0-curl - CURL module for PHP
php7.0-dev - Files for PHP7.0 module development
php7.0-gd - GD module for PHP
php7.0-gmp - GMP module for PHP
php7.0-json - JSON module for PHP
php7.0-ldap - LDAP module for PHP
php7.0-mysql - MySQL module for PHP
php7.0-odbc - ODBC module for PHP
php7.0-opcache - Zend OpCache module for PHP
php7.0-pgsql - PostgreSQL module for PHP
php7.0-pspell - pspell module for PHP
php7.0-readline - readline module for PHP
php7.0-recode - recode module for PHP
php7.0-snmp - SNMP module for PHP
php7.0-sqlite3 - SQLite3 module for PHP
php7.0-tidy - tidy module for PHP
php7.0-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP
php7.0-xmlrpc - XMLRPC-EPI module for PHP
libphp7.0-embed - HTML-embedded scripting language (Embedded SAPI library)
php7.0-bcmath - Bcmath module for PHP
php7.0-bz2 - bzip2 module for PHP
php7.0-enchant - Enchant module for PHP
php7.0-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
php7.0-imap - IMAP module for PHP
php7.0-interbase - Interbase module for PHP
php7.0-intl - Internationalisation module for PHP
php7.0-mbstring - MBSTRING module for PHP
php7.0-mcrypt - libmcrypt module for PHP
php7.0-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary)
php7.0-soap - SOAP module for PHP
php7.0-sybase - Sybase module for PHP
php7.0-xsl - XSL module for PHP (dummy)
php7.0-zip - Zip module for PHP
php7.0-dba - DBA module for PHP

now to install packages run the following command with your desired package现在要安装软件包,请使用所需的软件包运行以下命令

sudo apt-get install -y php7.0-gd, php7.0-intl, php7.0-xsl, php7.0-mbstring

Note : php7.0-mbstring , php7.0-gd php7.0-intl php7.0-xsl are the package that are listed above.注意php7.0-mbstring , php7.0-gd php7.0-intl php7.0-xsl是上面列出的包。

UPDATE : Don't forget to restart apache/<your_server>更新:不要忘记重新启动apache/<your_server>

sudo service apache2 reload

这是我尝试在新的 WSL 安装上安装 Laravel 时的修复:

sudo apt-get install php7.2-gd

sudo apt-get install php7.2-intl

sudo apt-get install php7.2-xsl

sudo apt-get install php7.2-zip

On Ubuntu 16.04 php7 is now the default, so if you follow the top answers and are still having this issue, check your php version.在 Ubuntu 16.04 上 php7 现在是默认设置,因此如果您按照最佳答案进行操作并且仍然遇到此问题,请检查您的 php 版本。

php --version

If your default php version is php7, but you followed an answer using php5 packages, you can use the following command to set the default version of php to php5.6:如果您的默认 php 版本是 php7,但您遵循使用 php5 包的答案,则可以使用以下命令将 php 的默认版本设置为 php5.6:

sudo update-alternatives --set php $(which php5.6)

更新....对于 ubuntu 用户

sudo apt-get install libapache2-mod-php php-common php-gd php-mysql php-curl php-intl php-xsl php-mbstring php-zip php-bcmath php-soap php-xdebug php-imagick

The exact name of the extension depends on the repository from which you got PHP but look here .扩展的确切名称取决于您从中获取 PHP 的存储库,但请查看此处 For example on CentOS:例如在 CentOS 上:

yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring php56w-bcmath

I used below to fix issue我用下面来解决问题

yum install -y php-intl php-xsl php-opcache php-xml php-mcrypt php-gd php-devel php-mysql php-mbstring php-bcmath yum install -y php-intl php-xsl php-opcache php-xml php-mcrypt php-gd php-devel php-mysql php-mbstring php-bcmath

For me为我

sudo apt-get install php5-mcrypt 

solved the issue解决了这个问题

Gonna post this answer here after seeing some of the answers (including the accepted one) which claim to "do the trick".在看到一些声称“做到了这一点”的答案(包括已接受的答案)后,将在此处发布此答案。 First, we need to identify the issue before fixing it.首先,我们需要在解决问题之前确定问题。

the requested PHP extension gd is missing from your system.您的系统中缺少请求的 PHP 扩展 gd。

As the above line clearly states, we need to install the extension php-gd.正如上面一行明确指出的,我们需要安装扩展 php-gd。

So, we can go with sudo apt install php<version>-gd and it should fix this error unless the system needs more extensions which happens to be the exact case here in the system in question.因此,我们可以使用sudo apt install php<version>-gd并且它应该修复此错误,除非系统需要更多扩展,这恰好是相关系统中的确切情况。 It needs a couple more extensions php-intl and php-xsl.它需要几个扩展 php-intl 和 php-xsl。 So let it be mbstring or mcrypt, you should install whatever the extensions your system is missing.因此,让它成为 mbstring 或 mcrypt,您应该安装系统缺少的任何扩展。 How can you find what is missing?你怎么能找到丢失的东西? Just read the error message, it is there.只需阅读错误消息,它就在那里。

它帮助我安装了正确的 curl 版本

sudo apt-get install php5-curl
  1. Open the xampp/php/php.ini file in any editor在任何编辑器中打开 xampp/php/php.ini 文件
  2. Search ";extension=php_intl.dll"搜索“;extension=php_intl.dll”
  3. Remove the starting semicolon ( ; )删除起始分号 ( ; )

    Like: ;extension=php_intl.dll to extension=php_intl.dll比如: ;extension=php_intl.dllextension=php_intl.dll

This helped me.这对我有帮助。

Installing PHP extensions:安装 PHP 扩展:

sudo apt-get install -y php-gd

sudo apt-get install -y php-intl

sudo apt-get install -y php-xsl

sudo apt-get install -y php-mbstring

for similar case:对于类似情况:

  • /etc/php/7.3/cli/php.ini /etc/php/7.3/cli/php.ini
  • /etc/php/7.3/cli/conf.d/10-mysqlnd.ini /etc/php/7.3/cli/conf.d/10-mysqlnd.ini
  • /etc/php/7.3/cli/conf.d/10-opcache.ini /etc/php/7.3/cli/conf.d/10-opcache.ini
  • /etc/php/7.3/cli/conf.d/10-pdo.ini /etc/php/7.3/cli/conf.d/10-pdo.ini
  • /etc/php/7.3/cli/conf.d/20-calendar.ini /etc/php/7.3/cli/conf.d/20-calendar.ini
  • /etc/php/7.3/cli/conf.d/20-ctype.ini /etc/php/7.3/cli/conf.d/20-ctype.ini
  • /etc/php/7.3/cli/conf.d/20-exif.ini /etc/php/7.3/cli/conf.d/20-exif.ini
  • /etc/php/7.3/cli/conf.d/20-fileinfo.ini /etc/php/7.3/cli/conf.d/20-fileinfo.ini
  • /etc/php/7.3/cli/conf.d/20-ftp.ini /etc/php/7.3/cli/conf.d/20-ftp.ini
  • /etc/php/7.3/cli/conf.d/20-gettext.ini /etc/php/7.3/cli/conf.d/20-gettext.ini
  • /etc/php/7.3/cli/conf.d/20-iconv.ini /etc/php/7.3/cli/conf.d/20-iconv.ini
  • /etc/php/7.3/cli/conf.d/20-json.ini /etc/php/7.3/cli/conf.d/20-json.ini
  • /etc/php/7.3/cli/conf.d/20-mbstring.ini /etc/php/7.3/cli/conf.d/20-mbstring.ini
  • /etc/php/7.3/cli/conf.d/20-mysqli.ini /etc/php/7.3/cli/conf.d/20-mysqli.ini
  • /etc/php/7.3/cli/conf.d/20-pdo_mysql.ini /etc/php/7.3/cli/conf.d/20-pdo_mysql.ini
  • /etc/php/7.3/cli/conf.d/20-phar.ini /etc/php/7.3/cli/conf.d/20-phar.ini
  • /etc/php/7.3/cli/conf.d/20-posix.ini /etc/php/7.3/cli/conf.d/20-posix.ini
  • /etc/php/7.3/cli/conf.d/20-readline.ini /etc/php/7.3/cli/conf.d/20-readline.ini
  • /etc/php/7.3/cli/conf.d/20-shmop.ini /etc/php/7.3/cli/conf.d/20-shmop.ini
  • /etc/php/7.3/cli/conf.d/20-sockets.ini /etc/php/7.3/cli/conf.d/20-sockets.ini
  • /etc/php/7.3/cli/conf.d/20-sysvmsg.ini /etc/php/7.3/cli/conf.d/20-sysvmsg.ini
  • /etc/php/7.3/cli/conf.d/20-sysvsem.ini /etc/php/7.3/cli/conf.d/20-sysvsem.ini
  • /etc/php/7.3/cli/conf.d/20-sysvshm.ini /etc/php/7.3/cli/conf.d/20-sysvshm.ini
  • /etc/php/7.3/cli/conf.d/20-tokenizer.ini /etc/php/7.3/cli/conf.d/20-tokenizer.ini

solved with :解决了:

apt-get install php-dom
apt-get install php-mbstring

它在服务器上运行良好

composer install --no-dev

暂无
暂无

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

相关问题 要启用扩展,请验证它们是否已在您的 .ini 文件中启用 - 使用 XAMPP 的 Windows - To enable extensions, verify that they are enabled in your .ini files - Windows using XAMPP 安装doctrine-mongodb-admin-bundle :: error:要启用扩展,请确认您的.ini文件中已启用扩展: - Install doctrine-mongodb-admin-bundle::error:To enable extensions, verify that they are enabled in your .ini files: 当我使用 Composer 更新或更新新扩展时,出现错误提示验证它们是否已在您的 .ini 文件中启用 - when I use composer update or update new extensions, get error says verify that they are enabled in your .ini files 如何通过PHP CODE在PHP.ini中启用扩展检查 - How to check extensions are enabled in PHP.ini via PHP CODE 如何解决php.ini中的启用扩展? - How can i resolve the enable the extensions in php.ini? 如何在 vagrant up 上自动启用 Homestead 中的 php 扩展 - How to automatically enable php extensions in Homestead on vagrant up 无法在App Engine for Laravel上的php.ini上启用PHP扩展 - Can't Enable PHP Extensions on php.ini on App Engine for Laravel 缺少以下扩展! 请在 php.ini 中启用 PHP 扩展 - The following extensions are missing! Please enable the PHP extension(s) in php.ini 如何在php.ini中为oci8(Oracle)启用扩展 - PHP警告:PHP启动:在第0行的未知中 - How to enable extensions for oci8 (Oracle) in php.ini - PHP Warning: PHP Startup: in Unknown on line 0 在Nginx安装页面上安装Magento 2.0.2无法正常运行 - Installing Magento 2.0.2 on Nginx setup page not functioning
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM