简体   繁体   English

无法安装 Magento 2

[英]Cant install Magento 2

I can't install Magento 2 on Server https://prnt.sc/tqrb6n By trying to do command composer install.我无法通过尝试执行命令 composer install 在服务器https://prnt.sc/tqrb6n上安装 Magento 2。 Maybe some one how.也许有人如何。 How to fix this issue.如何解决这个问题。

[root@junisoft junisoft.ru]# composer instal
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - This package requires php ~7.3.0||~7.4.0 but your PHP version (7.1.28) does not satisfy that requirement.
  Problem 2
    - Installation request for magento/composer 1.6.0 -> satisfiable by magento/composer[1.6.0].
    - magento/composer 1.6.0 requires php ~7.3.0||~7.4.0 -> your PHP version (7.1.28) does not satisfy that requirement.

It seems that problem is with your current php version.看来问题出在您当前的 php 版本上。 it would require your php7.3 version to install magento它需要你的 php7.3 版本来安装 magento

You can verify that your current php version by below command.您可以通过以下命令验证您当前的 php 版本。

php -v

it will display the current PHP version.它将显示当前的 PHP 版本。

You can change command-line PHP version by below command您可以通过以下命令更改命令行 PHP 版本

update-alternatives --config php

in your case to resolve above error change it to php7.3 if require you can prefix the command with the sudo access rights.在您的情况下,如果需要解决上述错误,请将其更改为 php7.3,您可以在命令前加上 sudo 访问权限。

for webversion php change you can run对于 webversion php 更改您可以运行

a2enmod php7.* 

replace 7.* with the version you required and after that restart apache or ngix services将 7.* 替换为您需要的版本,然后重新启动 apache 或 ngix 服务

incase of apache 2 you can run below command also在 apache 2 的情况下,您也可以运行以下命令

/etc/init.d/apache2 restart

if require sudo privilege you can run the command with the sudo access.如果需要 sudo 权限,您可以使用 sudo 访问权限运行命令。

Note: For some server related operation please make sure to run this command with some knowledge or you can also ask server admin help to configure the same.注意:对于一些与服务器相关的操作,请确保在具有一定知识的情况下运行此命令,或者您也可以请求服务器管理员帮助进行配置。

Try with the below way,试试下面的方法,

Use --ignore-platform-reqs使用--ignore-platform-reqs

for example:- composer install --ignore-platform-reqs例如:- composer install --ignore-platform-reqs

it's will ignore platform requirement problem like php version and etc etc.它会忽略平台要求问题,如 php 版本等。

Thanks.谢谢。

Your installed PHP version 7.1.* is not compatible with the Magento 2 version you are trying to install.您安装的 PHP 版本 7.1.* 与您尝试安装的 Magento 2 版本不兼容。 The Magento 2 version that you want to install is looking for PHP 7.3.* or PHP 7.4.* which is not there on the server.您要安装的 Magento 2 版本正在寻找 PHP 7.3.* 或 PHP 7.4.*,但服务器上没有。

The very first line of the error statement clearly says that your PHP version is not compatible with the Magento 2 version you are trying to install.错误声明的第一行清楚地表明您的 PHP 版本与您尝试安装的 Magento 2 版本不兼容。

You need to contact your Hosting service provider to update your PHP to the required version which is PHP7.3.* or PHP7.4.*.您需要联系您的托管服务提供商,将您的 PHP 更新到所需的版本,即 PHP7.3.* 或 PHP7.4.*。 Only after updating your PHP, you will be able to install the Magento 2 version which is mentioned in your composer.json file.只有更新您的 PHP 后,您才能安装 Magento 2 版本,该版本在您的 composer.json 文件中提到。

I found one similar article here https://technicallysound.in/magento-2-upgrade-and-composer-issues/ .我在这里找到了一篇类似的文章https://technicalsound.in/magento-2-upgrade-and-composer-issues/ This explains about composer incompatibility issue with the extensions you are trying to install via Composer.这解释了您尝试通过 Composer 安装的扩展的作曲家不兼容问题。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM