Downgrade from PHP 7.1 to 7.0 for Laravel project - xampp

I work with an application in Laravel, facing a problem that cant be solved unless downgrading. So I downgrade my XAMPP form 7.1.14 to 7.0.30
After install it, I open my project and run composer update
Your requirements could not be resolved to an installable set of packages.
Problem 1
- This package requires php 7.0.30 but your PHP version (7.1.14) does not satisfy that requirement.
The version doesn't change and the project not working !!!

Uninstall XAMPP and re-install with your suitable version. In past, I have faced same problem. I had problem for upgrade.

Just lower the laravel version in composer.json file, it will automatically use necessary version of PHP

Related

Breeze for Laravel 7?

Is there a way to install Breeze (via composer) into a new Laravel v7 project?
Whenever I try composer require laravel/breeze --dev
I get failure with message:
Cannot use laravel/breeze's latest version v1.17.0 as it requires php ^8.0.2 which is not satisfied by your platform.
./composer.json has been updated
Running composer update laravel/breeze
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
I don't want to use v9 of laravel or php8 due to work on older code.
I created v7 laravel project via composer: composer create-project laravel/laravel:7.* example_app_name
Is there a similar command for previous versions of Breeze? And if so, which version would apply?
No, it should not be possible. Even version 0.0.1 requires Laravel 8.
If you upgrade to Laravel 8 (8.42 minimum version), you should be able to install breeze up to version 1.10

Composer version downgrade issue

So I am currently trying to set up an old Laravel project, which requires PHP 7.1. I have successfully downgraded from 8.1 to 7.1, but now the composer issue appears:
I am trying to run composer install on a project, in order to install the dependecies needed, but I am facing the composer version error. After running the suggested command, it basically shows the same error, which does not really make any sense. I have tried other commands but seems like the issue is the same.
I am using MAC.
Any idea?
The message tells you that the current version of Composer installed cannot be run with the current version of PHP installed. Even downgrading is not possible.
To overcome this, you could update PHP again to any supported version (as in: 7.2.5 or later), then downgrade Composer to v2.2, then downgrade PHP again to 7.1.
If you want to ease the switch between PHP versions, you could check for a containerized PHP setup using Docker.

Installing Prestashop developer version

I wonder if anyone has experiencing installing Prestashop 1.7 dev version on Windows 10? I cloned the developer vbersion of Prestashop from the official git repo and initiated the install. The install asks me to run the command "php composer.phar install" so I did and get the following error when I do:
Problem 1
- composer/installers is locked to version v1.7.0 and an update of this package was not requested.
- composer/installers v1.7.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match your constraint.
Use the option --with-all-dependencies to allow updates and removals for packages currently locked to specific versions.
You are using a snapshot build of Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report an issue to them to ask them to support Composer 2. To work around this you can run Composer with --ignore-platform-reqs, but this will also ignore your PHP version and may result in bigger problems down the line.
I am running the latest version of composer on Windows 10 and am at a complete loss on how to proceed any further therefore any help would be appreciated.
According to the Prestashop team their development build is not yet compatible with Composer 1.10.5 hence the errors I encountered.
Thanks.

Unable to download any pdf packages via composer for larvel 5.5

i am using laravel 5.5 with php 7.0 version, I want to generate a pdf, i tried to install many pdf packages, but unable to install because of php 7.0 version, it requires min 7.1 to install any packages, i tried to find packages for 7.0 verision, but failed.
can anyone help me how to install package for php 7.0 veriosn
Below is the error, that i am getting,
Your requirements could not be resolved to an installable set of packages.
Problem 1 - nwidart/laravel-modules 4.1.0 requires php >=7.1 -> your PHP version (7.0.33) does not satisfy that requirement.
There are only 2 solutions out of this, You either upgrade your PHP version to 7.1 or downgrade your package versions which uses PHP7.0
If you tell me what packages are you using,I could help you out find the packages. Let me know what your use case is exactly, or why your cant upgrade to PHP7.1
Also it is important to note that PHP7.0 includes security vulnerabilities fixed in PHP7.1, So consider upgrading your framework to at-least Laravel 5.8
Edit:
here is a package for pdp utilities in laravel 5.5 -> https://github.com/niklasravnsborg/laravel-pdf
For laravel5.5 you will have to manually link the packages as auto discovery will not work.
Edit 2:
here is the problem, When you use composer require barryvdh/laravel-dompdf the composer installs the latest package which is 0.8.4 (compatible with PHP7.1 and higher), What you need to do instead is add the package manually to the composer file and then bind the version 0.8.3 like this under the require object -> "barryvdh/laravel-dompdf": "0.8.3" and then run composer update/install in the terminal

Laravel 5.0 php artisan tinker throwing an error on homestead with php7

I'm using Laravel 5.0 and homestead 0.4.0 wich is shipped with php 7,
so when I use php artisan tinker I get this error:
error
How can I fix this or should I downgrade my php version and if so wouldn't be any conflict with composer or any other tool in my homestead or laravel?
It seems that one of the libraries your application is using - PhpParser - is not compatible with PHP7. It defines a class called String which is a reserved keyword in version 7.
You need to either downgrade to PHP5 or check if it's possible to upgrade your dependencies so that used PhpParser library is compatible with PHP7. Version 2.x of PhpParser should be compatible.
If you're including the package directly in your composer.json try to upgrade version there.
If not, you can see which of your dependencies requires PhpParser by calling
composer depends nikic/php-parser
See if you are able to upgrade versions of packages it lists.
I solved my problem by installing an older version of homestead v0.3.3 wich is shipped with php 5.6 so here is all you need to download it:
$vagrant box add laravel/homestead --box-version 0.3.3
and then download an older version of Homestead installer from git, I'm using v2.1.8 it works fine:

Resources