How to install laravel 7 with php version 8 - 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.

Related

laravel 7 installation

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.

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.

install spatie/laravel-activitylog in Laravel 5.3

I am trying to install "spatie/laravel-activitylog" in Laravel install using command composer require spatie/laravel-activitylog
But I am getting the error that says
Don't install Laravel 5.3
But I don't want to update the Laravel version.
I think If I try to install an older version of "spatie/laravel-activitylog". It won't have any compatibility issues with Laravel 5.3.
But I don't know which older version of this package will be best for Laravel 5.3.
The latest version requires Laravel 5.5. That is why you get the error. To use spatie/laravel-activitylog you need to upgrade Laravel or download an earlier version.
If you look at the requirements for version 1 here: https://docs.spatie.be/laravel-activitylog/v1/requirements you find that:
The activitylog package requires PHP 7.0+ and Laravel 5.2 or higher.
This is sufficient with your need so you can install this version by specifying it like this:
composer require spatie/laravel-activitylog "^1.0"

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

Laravel Installer Version 1.3.3 and Framework 5.2 cannot be removed from my MAC

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

Categories