Composer says my PHP is too old but it isn't? - php

I am trying to install laravel valet on a new macbook, but I am hitting an issue upon installation.
I am installing it via
composer global require laravel/valet
Here is the issue:
Problem 1
- laravel/valet[v2.13.0, ..., v2.13.19] require illuminate/container ~5.1|^6.0|^7.0|^8.0 -> satisfiable by illuminate/container[v5.8.36].
- illuminate/container v5.8.36 requires php ^7.1.3 -> your php version (8.0.0) does not satisfy that requirement.
- Root composer.json requires laravel/valet ^2.13 -> satisfiable by laravel/valet[v2.13.0, ..., v2.13.19].
I am unsure what I am doing wrong? My PHP version is 8, its higher than all of the requirements.

The caret symbol (^) means "Must match major version number" not "Must be at least this version".
8.0.0 is greater than 7.1.3, and that is the problem. The software has an explicit dependency on version 7 (presumably because version 8 is still pretty new and illuminate/container hasn't been tested with and updated for it).
Now I'm speculating:
laravel/valet[v2.13.0, ..., v2.13.19] require illuminate/container ~5.1|^6.0|^7.0|^8.0 -> satisfiable by illuminate/container[v5.8.36].
says that it has picked quite an old version of illuminate/container. If you explicitly installed a newer version (like 8.0 which that line says meets the requirements) then it might resolve your problem.

Related

Composer update gives error phpunit/phpunit

I recently installed php (8.1.7) and composer (2.3.7) and laravel 9;
Now I am getting this error while running the command
composer update
on a laravel project, I searched a lot but couldn't find exact solution, all of them were not discussing the issue of phpunit/phpunit.
The error looks like this:
Problem 1
- phpunit/phpunit[6.0.0, ..., 6.5.14] require php ^7.0 -> your php version (8.1.7) does not satisfy that requirement.
- Root composer.json requires phpunit/phpunit ~6.0 -> satisfiable by phpunit/phpunit[6.0.0, ..., 6.5.14].```
You have to upgrade your phpunit version to correspond with your php 8.1.7 (choose between phpunit version 9 or 8, according to the official documentation) or downgrade your php version to works with phpunit 6.*.
That's it !

Old Laravel project is not working after a while, What can I do to make it running again?

I have an old project and I am not the person that worked on it
I need to run it again but it's giving me this error
This page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500
I tried to run composer update but it gives me this error
Problem 1
- Root composer.json requires php ^7.1.3 but your php version (8.1.5) does not satisfy that requirement.
Problem 2
- laravel/framework[v5.6.0, ..., 5.6.x-dev] require php ^7.1.3 -> your php version (8.1.5) does not satisfy that requirement.
- Root composer.json requires laravel/framework 5.6.* -> satisfiable by laravel/framework[v5.6.0, ..., 5.6.x-dev].
You can do composer install by following command
composer install --ignore-platform-reqs --no-script
Also another way can be to update your composer.json php version to 8 or downgrade your system php version to php7.
Hope it works.

Silverstripe Core upgrade from 3.5.6 to 3.6.6

I have a website built on Silverstripe 3.5.6 and I need to update it to 3.6.6 because it has php 7.0.
The documentation is very twisted and I don't understand anything. Basically what I tried was to open composer.json and change framework,cms versions from 3.5.6 to 3.6.6 and then via Terminal launch the "composer update" command, and I tought this will load the corresponding versions, but I get this error back:
- Installation request for silverstripe/framework 3.6.6#stable -> satisfiable by silverstripe/framework[3.6.6].
- silverstripe/framework 3.6.6 requires php >= 5.3.3, <7.2 -> your PHP version (7.2.11) does not satisfy that requirement.
Problem 2
- Installation request for silverstripe/reports 3.6.6#stable ->
satisfiable by silverstripe/reports[3.6.6].
- silverstripe/reports 3.6.6 requires php >=5.3.3,<7.2 -> your PHP
version (7.2.11) does not satisfy that requirement.
Problem 3
- silverstripe/framework 3.6.6 requires php >= 5.3.3, <7.2 -> your PHP
version (7.2.11) does not satisfy that requirement.
- silverstripe/display-logic 1.5.0 requires silverstripe/framework
^3.1
-> satisfiable by silverstripe/framework[3.6.6].
- Installation request for silverstripe/display-logic 1.5.0 -> satisfiable by silverstripe/display-logic[1.5.0].
From the log you posted:
silverstripe/framework 3.6.6 requires php >= 5.3.3, <7.2 -> your PHP
version (7.2.11) does not satisfy that requirement.
Silverstripe 3.x (prior to 3.7.0) only supports PHP 7 versions before 7.2. If you want to use PHP 7.2, you will need to upgrade to SilverStripe 3.7+ or Silverstripe 4.x.

Latest Laravel and latest WAMP issues

I have them both vanilla setup. Laravel setups up fine. But when i run composer install i get;
> Problem 1
- This package requires php ^7.1.3 but your PHP version (7.0.11) does not satisfy that requirement.
Problem 2
- Installation request for doctrine/inflector v1.3.0 -> satisfiable by doctrine/inflector[v1.3.0].
- doctrine/inflector v1.3.0 requires php ^7.1 -> your PHP version (7.0.11) does not satisfy that requirement.
Problem 3
....
Problem 24
- Installation request for sebastian/diff 3.0.1 -> satisfiable by sebastian/diff[3.0.1].
- sebastian/diff 3.0.1 requires php ^7.1 -> your PHP version (7.0.11) does not satisfy that requirement.
Problem 25
- laravel/framework v5.6.26 requires php ^7.1.3 -> your PHP version (7.0.11) does not satisfy that requirement.
- laravel/tinker v1.0.7 requires illuminate/console ~5.1 -> satisfiable by laravel/framework[v5.6.26].
- Installation request for laravel/tinker v1.0.7 -> satisfiable by laravel/tinker[v1.0.7].
A total of 25 problems when running composer on laravel...
I have understood so much my php version differs in minor version, but what can i do to fix it?
Thanks!
I think your laravel version wants php version >= 7.1.3 but your installed version is 7.0.11.
If you have installed latest laravel version i.e(5.6) then it should match following requirements:
PHP >= 7.1.3
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
Ctype PHP Extension
JSON PHP Extension
Please check laravel installation guide https://laravel.com/docs/5.6/installation#installation
Yea, there where mismatches in version. Strangley enough i downloaded another phpversion 7.2.xx. And it almost worked like a charm. They have some strange things going on eg. the extensions config directive s never prefixed with "php_" in the ini file and it is very easy to miss, so you will need to add it yourswelf also there are no extension dir config by default, you also need that one. Its commented out, another workhour to find this this.
Thanks for your reply!

Laravel 5.5. and PHP 7

I am updating to Laravel 5.5. which uses PHP 7.0 version. I need to do setup on my local machine and on AWS as well. First, locally WAMP server is installed which comes with PHP 7.0 ... I've selected it and when localhost is opened I get the message that the PHP version is 7.0.10 ... After changing version numbers for Laravel and PHP in composer.json, I did update and got this message:
Problem 1
This package requires php >=7.0 but your PHP version (5.6.25) does not satisfy that requirement. Problem 2
laravel/framework v5.5.2 requires php >=7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
laravel/framework v5.5.1 requires php >=7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
laravel/framework v5.5.0 requires php >=7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
Installation request for laravel/framework 5.5.* -> satisfiable by laravel/framework[v5.5.0, v5.5.1, v5.5.2].
It is written that I still use 5.6. How can I change this?
According to #iainn Apache is using PHP 7, but the CLI (which Composer uses) is still using 5.6 hence, trying to uninstall and install composer again and select the correct php version (7.0) while setup. Check below screenshot
You're getting an error from composer. Try using
'composer install --ignore-platform-reqs'
to setup your project folder.
Just change varible enviroment on your computer
add path php you would you like to use

Categories