laravel 错误:无法将您的要求解析为一组可安装的软件包。(在服务器上)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41790281/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 17:37:22  来源:igfitidea点击:

Error:Your requirements could not be resolved to an installable set of packages.(on server)

laravelcomposer-phplaravel-5.3

提问by YaSh Chaudhary

I am using laravel 5.3 for my project.Now I am setting it up to the server.

我正在为我的项目使用 laravel 5.3。现在我正在将它设置到服务器。

The problem occured when doing so.And i am stuck at this point of error.

这样做时出现了问题。我被困在这个错误点上。

WHEN I run

当我跑

composer install --no-dev

作曲家安装 --no-dev

command following error occurs:

命令出现以下错误:

 Problem 1
    - Installation request for fgrosse/phpasn1 1.5.2 -> satisfiable by fgrosse/phpasn1[1.5.2].
    - fgrosse/phpasn1 1.5.2 requires ext-gmp * -> the requested PHP extension gmp is missing from your system.
  Problem 2
    - Installation request for mdanter/ecc v0.4.2 -> satisfiable by mdanter/ecc[v0.4.2].
    - mdanter/ecc v0.4.2 requires ext-gmp * -> the requested PHP extension gmp is missing from your system.
  Problem 3
    - Installation request for pusher/pusher-php-server 2.6.3 -> satisfiable by pusher/pusher-php-server[2.6.3].
    - pusher/pusher-php-server 2.6.3 requires ext-curl * -> the requested PHP extension curl is missing from your system.
  Problem 4
    - pusher/pusher-php-server 2.6.3 requires ext-curl * -> the requested PHP extension curl is missing from your system.
    - laravel-notification-channels/pusher-push-notifications 1.0.2 requires pusher/pusher-php-server 2.6.* -> satisfiable by pusher/pusher-php-server[2.6.3].
    - Installation request for laravel-notification-channels/pusher-push-notifications 1.0.2 -> satisfiable by laravel-notification-channels/pusher-push-notifications[1.0.2].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.0/cli/php.ini
    - /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
    - /etc/php/7.0/cli/conf.d/10-opcache.ini
    - /etc/php/7.0/cli/conf.d/10-pdo.ini
    - /etc/php/7.0/cli/conf.d/20-calendar.ini
    - /etc/php/7.0/cli/conf.d/20-ctype.ini
    - /etc/php/7.0/cli/conf.d/20-exif.ini
    - /etc/php/7.0/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.0/cli/conf.d/20-ftp.ini
    - /etc/php/7.0/cli/conf.d/20-gettext.ini
    - /etc/php/7.0/cli/conf.d/20-iconv.ini
    - /etc/php/7.0/cli/conf.d/20-json.ini
    - /etc/php/7.0/cli/conf.d/20-mbstring.ini
    - /etc/php/7.0/cli/conf.d/20-mysqli.ini
    - /etc/php/7.0/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/7.0/cli/conf.d/20-phar.ini
    - /etc/php/7.0/cli/conf.d/20-posix.ini
    - /etc/php/7.0/cli/conf.d/20-readline.ini
    - /etc/php/7.0/cli/conf.d/20-shmop.ini
    - /etc/php/7.0/cli/conf.d/20-sockets.ini
    - /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.0/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.0/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.0/cli/conf.d/20-tokenizer.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

`

`

回答by Mahdi Youseftabar

Your PHP need some ext for run your packages.

你的 PHP 需要一些 ext 来运行你的包。

You can install that with apt-get if you use Ubuntu and PHP 5 :

如果您使用 Ubuntu 和 PHP 5,则可以使用 apt-get 安装它:

apt-get install php5-gmp 
apt-get install php5-curl

If you use PHP 7:

如果您使用 PHP 7:

apt-get install php7.0-gmp 
apt-get install php-curl

and etc...

等等...

After that restart your web service then it will work.

之后重新启动您的网络服务,然后它将工作。

回答by Mo D Genesis

First, check if composer is installed by doing.

首先,通过执行检查是否安装了composer。

composer -v

If it is installed, do the following sequence. This worked for me:

如果已安装,请执行以下顺序。这对我有用:

sudo apt-get install php7.2-zip
sudo apt-get install php-mbstring -y
sudo apt-get install php-xml -y

Then finally do this.

然后最后做这个。

composer install

回答by Fahim Sultan

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

After following these steps just restart the server again.

执行这些步骤后,只需再次重新启动服务器。

And then create a new laravel project by typing: "composer create-project laravel/laravel projectname" in your terminal.

然后通过在终端中键入:“composer create-project laravel/laravel projectname”来创建一个新的 Laravel 项目。

回答by James

Have you read your error message?

你读过你的错误信息吗?

You are missing two PHP extensions; gmpand curl.

您缺少两个 PHP 扩展;gmpcurl

You just need to install them, like so:

您只需要安装它们,如下所示:

sudo apt-get install php7.0-gmp
sudo apt-get install php-curl

This should enable them as part of installing them, otherwise you will just need to enable them manually.

这应该在安装它们时启用它们,否则您只需要手动启用它们。

Make sure you restart Apache after installing them - sudo service apache2 reload

确保在安装后重新启动 Apache - sudo service apache2 reload

回答by Pradeep Kumar

If you are facing this issue on php7.4 then please check the following extensions should be installed :

如果您在 php7.4 上遇到此问题,请检查是否应安装以下扩展:

sudo apt-get install php7.4-bcmath sudo apt-get install php7.4-common sudo apt-get install php7.4-json sudo apt-get install php7.4-mbstring sudo apt-get install php7.4-xml

sudo apt-get install php7.4-bcmath sudo apt-get install php7.4-common sudo apt-get install php7.4-json sudo apt-get install php7.4-mbstring sudo apt-get install php7.4-xml

回答by Ashish Rathaur

according my php version, check your php version using php -v

根据我的 php 版本,使用 php -v 检查你的 php 版本

sudo apt-get install php7.3-dom

须藤 apt-get 安装 php7.3-dom