Laravel 5.5. and PHP 7 - php

I am updating to Laravel 5.5. which uses PHP 7.0 version. I need to do setup on my local machine and on AWS as well. First, locally WAMP server is installed which comes with PHP 7.0 ... I've selected it and when localhost is opened I get the message that the PHP version is 7.0.10 ... After changing version numbers for Laravel and PHP in composer.json, I did update and got this message:
Problem 1
This package requires php >=7.0 but your PHP version (5.6.25) does not satisfy that requirement. Problem 2
laravel/framework v5.5.2 requires php >=7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
laravel/framework v5.5.1 requires php >=7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
laravel/framework v5.5.0 requires php >=7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
Installation request for laravel/framework 5.5.* -> satisfiable by laravel/framework[v5.5.0, v5.5.1, v5.5.2].
It is written that I still use 5.6. How can I change this?

According to #iainn Apache is using PHP 7, but the CLI (which Composer uses) is still using 5.6 hence, trying to uninstall and install composer again and select the correct php version (7.0) while setup. Check below screenshot

You're getting an error from composer. Try using
'composer install --ignore-platform-reqs'
to setup your project folder.

Just change varible enviroment on your computer
add path php you would you like to use

Related

Old Laravel project is not working after a while, What can I do to make it running again?

I have an old project and I am not the person that worked on it
I need to run it again but it's giving me this error
This page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500
I tried to run composer update but it gives me this error
Problem 1
- Root composer.json requires php ^7.1.3 but your php version (8.1.5) does not satisfy that requirement.
Problem 2
- laravel/framework[v5.6.0, ..., 5.6.x-dev] require php ^7.1.3 -> your php version (8.1.5) does not satisfy that requirement.
- Root composer.json requires laravel/framework 5.6.* -> satisfiable by laravel/framework[v5.6.0, ..., 5.6.x-dev].
You can do composer install by following command
composer install --ignore-platform-reqs --no-script
Also another way can be to update your composer.json php version to 8 or downgrade your system php version to php7.
Hope it works.

laravel/framework v6.9.0 requires php ^7.2

I just finish my laravel project on my local machine, I want to upload to my server to become live api, okay, I searched, youtubed, googled, or etc.. and found some solution for upload, I just upload my whole project, without vendor, and composer.lock, not set database config yet. after upload, I run:
composer install
it give me some error about php version:
Problem 1
- laravel/framework v6.9.0 requires php ^7.2 -> your PHP version (7.1.33) overridden by "config.platform.php" version (5.5.9) does not
satisfy that requirement.
But my php version is:
PHP Version 7.3.13
How can I fix this?
Check your .bash_profile on ~ root and add this lines:
PATH="/usr/local/php73/bin:$PATH" // make sure your path to php73
export PATH
then:
php -v -> reboot -> php -v

Silverstripe Core upgrade from 3.5.6 to 3.6.6

I have a website built on Silverstripe 3.5.6 and I need to update it to 3.6.6 because it has php 7.0.
The documentation is very twisted and I don't understand anything. Basically what I tried was to open composer.json and change framework,cms versions from 3.5.6 to 3.6.6 and then via Terminal launch the "composer update" command, and I tought this will load the corresponding versions, but I get this error back:
- Installation request for silverstripe/framework 3.6.6#stable -> satisfiable by silverstripe/framework[3.6.6].
- silverstripe/framework 3.6.6 requires php >= 5.3.3, <7.2 -> your PHP version (7.2.11) does not satisfy that requirement.
Problem 2
- Installation request for silverstripe/reports 3.6.6#stable ->
satisfiable by silverstripe/reports[3.6.6].
- silverstripe/reports 3.6.6 requires php >=5.3.3,<7.2 -> your PHP
version (7.2.11) does not satisfy that requirement.
Problem 3
- silverstripe/framework 3.6.6 requires php >= 5.3.3, <7.2 -> your PHP
version (7.2.11) does not satisfy that requirement.
- silverstripe/display-logic 1.5.0 requires silverstripe/framework
^3.1
-> satisfiable by silverstripe/framework[3.6.6].
- Installation request for silverstripe/display-logic 1.5.0 -> satisfiable by silverstripe/display-logic[1.5.0].
From the log you posted:
silverstripe/framework 3.6.6 requires php >= 5.3.3, <7.2 -> your PHP
version (7.2.11) does not satisfy that requirement.
Silverstripe 3.x (prior to 3.7.0) only supports PHP 7 versions before 7.2. If you want to use PHP 7.2, you will need to upgrade to SilverStripe 3.7+ or Silverstripe 4.x.

Latest Laravel and latest WAMP issues

I have them both vanilla setup. Laravel setups up fine. But when i run composer install i get;
> Problem 1
- This package requires php ^7.1.3 but your PHP version (7.0.11) does not satisfy that requirement.
Problem 2
- Installation request for doctrine/inflector v1.3.0 -> satisfiable by doctrine/inflector[v1.3.0].
- doctrine/inflector v1.3.0 requires php ^7.1 -> your PHP version (7.0.11) does not satisfy that requirement.
Problem 3
....
Problem 24
- Installation request for sebastian/diff 3.0.1 -> satisfiable by sebastian/diff[3.0.1].
- sebastian/diff 3.0.1 requires php ^7.1 -> your PHP version (7.0.11) does not satisfy that requirement.
Problem 25
- laravel/framework v5.6.26 requires php ^7.1.3 -> your PHP version (7.0.11) does not satisfy that requirement.
- laravel/tinker v1.0.7 requires illuminate/console ~5.1 -> satisfiable by laravel/framework[v5.6.26].
- Installation request for laravel/tinker v1.0.7 -> satisfiable by laravel/tinker[v1.0.7].
A total of 25 problems when running composer on laravel...
I have understood so much my php version differs in minor version, but what can i do to fix it?
Thanks!
I think your laravel version wants php version >= 7.1.3 but your installed version is 7.0.11.
If you have installed latest laravel version i.e(5.6) then it should match following requirements:
PHP >= 7.1.3
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
Ctype PHP Extension
JSON PHP Extension
Please check laravel installation guide https://laravel.com/docs/5.6/installation#installation
Yea, there where mismatches in version. Strangley enough i downloaded another phpversion 7.2.xx. And it almost worked like a charm. They have some strange things going on eg. the extensions config directive s never prefixed with "php_" in the ini file and it is very easy to miss, so you will need to add it yourswelf also there are no extension dir config by default, you also need that one. Its commented out, another workhour to find this this.
Thanks for your reply!

yii2 : xampp upgrade to php7

I have a new project in yii2, I downloaded yii2 using composer and when I try to download the extension it tells me to upgrade my PHP from 5 to 5.6 or higher. Then I upgraded it to 7.1.3 the old projects works fine and the phpMyAdmin too afterwards I tried to install the extension again. It gives me the same message.
Problem 1
sebastian/version 2.0.1 requires php >=5.6 -> your PHP version (5.5.34) does not satisfy that requirement.
sebastian/version 2.0.1 requires php >=5.6 -> your PHP version (5.5.34) does not satisfy that requirement.
Installation request for sebastian/version (installed at 2.0.1) -> satisfiable by sebastian/version[2.0.1].
What is wrong here?

Categories