composer create-project --prefer-dist laravel/laravel:^7.0 blog using this command and I got error this
[InvalidArgumentException] Could not find package laravel/laravel
with version 7.0 in a version installable using your PHP version, PHP
exte nsions and Composer version.
Your PHP Version is not compatible with your Laravel version, If you are using XAMPP or other web servers, try to use the older version that is compatible with your Laravel-7 project file, and after that reinstall your Laravel-7 project.
Your PHP version is not compatible with Laravel version 7.0
Laravel 7 Docs
Laravel 7 requires PHP >= 7.2.5. Check your php version using php -v on terminal.
You can uninstall composer then again install it.
Related
Facing issue after downgrade the PHP version with updated version of composer,
I am trying to doing upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2 which option is given by CMD.
I tried myself with downgrade the PHP version using the Command of brew but I tried to get the solution for composer, Either it's possible to downgrade or upgrade the version of composer same like PHP.
I am geeting error when trying to install laravel 7 using php version 8. Is there any way i can solve this issue.
This message is telling you that no version of Laravel is available for the given version constraint (^7.0) and your PHP version.
Said otherwise all Laravel version from the 7.0 to the latest 7.x (^7.0) aren't compatible with your PHP version (which is probably too old).
You could also have missing extensions that are required by Laravel.
Three options here:
You try to fix those version problems and try again.
You bypass Composer checks by using the --ignore-platform-reqs flag: composer create-project --ignore-platform-reqs laravel/laravel:^7.0 blog. Composer will ignore the "platform requirements" and will install Laravel, however it might not work well.
You remove the version constraint and Composer will install the latest compatible Laravel version (if there is one, it depends on your extensions): composer create-project laravel/laravel blog.
You can check the PHP version by doing php --version, Laravel 7 requires at least PHP 7.2.
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
I'd like to use Laravel 5.4 on my production server but the latest PHP 5.6 version available is 5.6.30 (as my local XAMPP installation as well), while the requirements for Laravel 5.4 are php >= 5.6.40 as for https://packagist.org/packages/laravel/laravel
Now, I've successfully installed Laravel 5.4 on the server in a subdirectory via SSH and the home page is showing the Laravel logo. Is there some problems I could encounter using this version of PHP down the road? If so, is there any polyfill or adjustment to be made in order to use Laravel 5.4 on PHP 5.6.30 instead of PHP 5.6.40? Thanks
Laravel require php 5.6.4 as you can see here
and XAMPP is 5.6.30 - This version is NEWER than 5.6.4 ( see all php versions here )
So no problems are expected becase you are using newer version than required by Laravel.
composer create-project --prefer-dist laravel/laravel (project name) 5.4.*
that will install the latest version of laravel supported by php 5.6
see in the attachment above
composer create-project --prefer-dist laravel/laravel (project name) 5.4.*
Laravel 5.4 is compatible with PHP 7.x. Please check the following article.
https://murze.be/2016/01/why-we-are-requiring-php-7-for-our-new-packages/
Trying to install Spark Laravel 3 I realized that my current laravel installer was version 1.3.3. Laravel Spark request version 1.3.4.
several procedures were made in order to use version 1.3.4.
update composer
erase laravel installer from ~/.composer/vendor/bin
etc.
no matter what I do, it seems that the installer is loaded and used from some cache. consequently an old version 1.3.3 is installed.
Running composer global require "laravel/installer=~1.3.4" version 1.3.4 is installed. running laravel -V says 1.3.4 but then when I install in
localhost/laravel
and run laravel -V it says 1.3.3
UPDATE//////////////////////////////////////////////////
following bagus-tesa advise i used composer global remove laravel/installer with success.
Im confused, because despite in ~/.composer/bin calling laravel -V displays 1.3.4 when I install laravel spark it always install laravel version 5.2 instead of version laravel 5.3
anyone knows if spark laravel has a place in configuration to force installing laravel 5.3 version? brgds
Install
composer global require "laravel/installer=~1.3.4"
Uninstall
composer global remove laravel/installer
laravel installer is just an alternative way to create laravel project. I have not find it so useful in my opinion.
You can do the same thing using composer:
composer create-project laravel/laravel=5.3.0 projectName --prefer-dist
If it does not work, make sure you have the minimum PHP version required for the chosen laravel version