Laravel 5.4 PHP requirements (5.6.30 vs 5.6.40) - php

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/

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.

How to install laravel 5.8 with xamp

i am newbie with laravel and tryng to download 5.8 version in a server xamp.
But, when i try the command in the terminal of Xamp:
composer create-project --prefer-dist laravel/laravel blog "5.8.*"
returns
[InvalidArgumentException]
Could not find package laravel/laravel with version 5.8.* in a version installable using your PHP verson 8.0.5
Someone have a idea of what i can do?
Laravel 5.8 doesn't support php 8, you should probably consider using laravel 8
Xampp versions follows PHP's, so you should download something like 7.1.3x. This can be done on the download page, assuming you are using windows this is the link.
In general for choosing PHP versions, it is most optimal to go with the version that is used on the production server.
If you really want to use Laravel 5.4, then you'd need to go with PHP 7.* and I'd recommend going with Wamp (https://www.wampserver.com/en/) instead of Xampp, which allows you to switch between php versions with one click.
However try using laravel 8 if laravel 5.4 is not a requirement

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