How to fix magento 2 error while installing one module - php

I am have my magento 2 website and I want to install one module using below command
composer require eway/eway-rapid-magento2 3.0.1
but I am getting following error
magento/framework 100.1.15 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.1.27) does not satisfy that requirement.
Please let me know how to fix this issue.
Thanks

Ignore platform requirements (php & ext- packages).
composer require eway/eway-rapid-magento2 3.0.1 --ignore-platform-reqs

As stated already, php version is not correct for this module version, so either update php version or update the module version, which one is satisfying by the php version.

Related

Cant install Magento 2

I can't install Magento 2 on Server https://prnt.sc/tqrb6n
By trying to do command composer install. 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. it would require your php7.3 version to install magento
You can verify that your current php version by below command.
php -v
it will display the current PHP version.
You can change command-line PHP version by below command
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.
for webversion php change you can run
a2enmod php7.*
replace 7.* with the version you required and after that restart apache or ngix services
incase of apache 2 you can run below command also
/etc/init.d/apache2 restart
if require sudo privilege you can run the command with the sudo access.
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
for example :- composer install --ignore-platform-reqs
it's will ignore platform requirement problem like php version and etc etc.
Thanks.
Your installed PHP version 7.1.* is not compatible with the Magento 2 version you are trying to install. 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.
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.
You need to contact your Hosting service provider to update your PHP to the required version which is PHP7.3.* or 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.
I found one similar article here https://technicallysound.in/magento-2-upgrade-and-composer-issues/. This explains about composer incompatibility issue with the extensions you are trying to install via Composer.

laravel role based spatie package unable to install

I am using php 7.0.33 version and laravel 5.5, I want to download the spatie package, but its not installing. I am getting an error with php 7.0.33 not supported. I tried to install with 7.0.33 package but unable to install.
Can anyone give me a suggestion on how to install it php 7.0 version?
I don't want to update my php version.
composer require "spatie/laravel-medialibrary:^7.0.0"
Your requirements could not be resolved to an installable set of packages.
Try
composer require spatie/laravel-medialibrary:^6.0.0
This library version must be correct for your php's version and Laravel.

Upgrade laravel

Hello after I installed Laravel,
I try to update the version 5.5 to 5.6 and unable to throws me an error:
- laravel/framework v5.6.9 requires php ^7.1.3 -> your PHP version (7.0.10) does not satisfy that requirement.
I use XAMPP with PHP 7.2.10.
I installed Composer with php 7 And does not help.
Thanks
Have a look at your composer.json. It is possible that there is a configuration parameter config.platform.php which contains the value 7.0.10. This feature allows to simulate a specific PHP version to composer. If you don't need it, you can remove it or force composer to install anyway by using the --ignore-platform-reqs parameter when updating the packages.
If you are on Linux Debian, you can easily install the latest version of php with sudo apt-get install php x.x. On windows, this link might help. Then, try installing or upgrading Laravel from cmd and it should work sweet! Re-installing the latest verion of XAMPP may also do the work for you.
You have to update your system's PATH environment variable so that it finds the newer version of php from your command line. You might have more than one installed right now, so it uses the first one it finds when it looks through the directories defined in your PATH. After updating the path variable, you might have to log out for it to apply.
You can check the version used by your command line with php --version. To see which version Apache is configured with, use phpinfo().

Use the latest Laravel version

Lately l've been working with Laravel. I use composer to install packages and artisan for commands.
The problem is that my machine uses Laravel 5.4 not 5.7.
When i run phpinfo() the result is PHP Version 7.2.7. Do you think that the problem is that i don't use the latest version of xampp which it has included php 7?
Based on comment, yes it is related to PHP version. Your PHP CLI version is too low to support newer version of laravel. You need to update or switch PHP CLI to newer version. Server and CLI PHP are separate packages and might have different versions.
No it is not related to PHP version (in this case).
Probably you ran
composer install
which will install dependencies in versions defined in composer.lock to update dependencies run
composer update
For differences between install and update you can refer to this question
From the comments:
laravel/framework v5.5.9 requires php >=7.0 -> your PHP version (5.6.19) does not satisfy that requirement.
Run php -i in the Terminal. Looks like your webserver and your command line (which Composer uses) are using different versions of PHP.
Laravel version depends on your installation way. It's not related to your PHP or XAMPP version. And you are using the latest PHP version, so don't worry about PHP version.
Read the Laravel installation to install the latest version of laravel.
If you using package laravel/installer
Update this package
composer global update
and try to run
laravel new my-app

Issue with installing zendframework2 skeleton

i'm new to zendframework 2 , while trying to install it , using composer , it gets installed but an error message appears saying :
Your requirements could not be resolved to an installable set of packages.
Problem1
- Installation request for zendframework/zendframework 2.3.* -> satisfiable by zendframework/zendframework[2.3.0].
- zendframework/zendframework 2.3.0 requires php >=5.3.23 -> no matching package found
knowing that I have php 5.4.3.
Could someone please explain to me what's wrong ?
thanks in advance
Make sure the PHP version you are using for the CLI is using PHP 5.4.3 too. The CLI version can use a different PHP version than the host. You can get the php version used by the console by using the php --version command.

Categories