Laravel Composer sees wrong PHP Version
I've had this problem too. If you don't want to update all your composer packages, you can solve this issue by manually changing the composer.lock
file and writing your actual PHP version in platform > php
in the JSON object.
Example
...
"platform": {
"php": "7.1"
}
...
Although it works, the most recommended way to do this would be deleting your composer.lock
file, changing the platform > php
version in composer.json
and then executing composer install
.
Composer uses wrong php version, but php -v shows the correct one (Ubuntu)
try this:
composer install --ignore-platform-reqs
or this in composer.json
"config": {
"preferred-install": "dist",
"platform": {
"php": "7.0.0"
}
}
in the second solution basically you're faking a platform, and run composer.phar update
after this
Laravel - Composer detected issues in your platform after updating it
Your terminal user's PHP version may differ from the server's version.
You may have 7.4.13 on terminal while having a completely different PHP version in apache2 or whatever server you are using.
Use phpinfo();
in a PHP file and access it via browser to see the actual PHP version.
Composer telling the wrong php version
I just realized this config at the bottom of my composer.json
:
"config": {
"platform": {
"php": "5.5.9"
}
},
That's the version on which it bases his warning (not the one actually used)
Related Topics
Query With Multiple Values in a Column
Sending Message in Telegram Bot With Images
Php Json String, Escape Double Quotes for Js Output
How to See If a User Is Online in a Website With PHP and MySQL Driven Databases
Regex - Exclude "-" Between Numbers
Laravel - How to Join 2 Tables from Different Db Connection
In Laravel How to Get Data in One Query from 3 Tables
Unset Post Variables After Form Submission
SQL Injection That Gets Around mysql_real_escape_string()
How to Download an Mp3 File from Remote Url
How to Use Two Foreach to Insert Data in Database
Checking Dates If Between Range of Dates in Laravel 5
Displaying Data from an Array in a HTML Table Using PHP
How to Count Occurrence of Duplicate Items in Array
How to Set the Default Value of an Attribute on a Laravel Model