Framework: Error creating a new project using PHP Version < 7.0

Created on 22 Jul 2017  路  30Comments  路  Source: laravel/framework

  • Laravel Version: 5.4.30
  • PHP Version: 5.6.31
  • Database Driver & Version: pgsql PostgreSQL 9.5.7 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609, 64-bit

Description:

Creating a new application with laravel command results in a composer error, doctrine/inflector has a new release version 1.2 wich requires minimum PHP 7.0

Steps To Reproduce:

$ laravel new Demo
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for doctrine/inflector v1.2.0 -> satisfiable by doctrine/inflector[v1.2.0].
- doctrine/inflector v1.2.0 requires php ^7.0 -> your PHP version (5.6.31) does not satisfy that requirement.
Problem 2
- doctrine/inflector v1.2.0 requires php ^7.0 -> your PHP version (5.6.31) does not satisfy that requirement.
- laravel/framework v5.4.30 requires doctrine/inflector ~1.0 -> satisfiable by doctrine/inflector[v1.2.0].
- Installation request for laravel/framework v5.4.30 -> satisfiable by laravel/framework[v5.4.30].

Application ready! Build something amazing.

Most helpful comment

@ArronStudio @rkgarcia try to delete composer.lock file in root folder and run composer install again.

All 30 comments

Hello,

when I鈥檓 doing a composer update it's working fine, but it fails for new projects, it's strange.
the requirements are ~1.0 for doctrine/inflector which is satisfiable by v1.1.0

i've downloaded the zip of v5.4.30 and installed and it works well
but with http://cabinet.laravel.com/latest.zip it doesn't work anymore.

There is a composer.lock inside the latest.zip, It was probably generated on php 7.0 so no warning.
I don't think it's normal to have a composer.lock in this zip, it's too environment-related to be included

I have the save problem.

@ArronStudio @rkgarcia try to delete composer.lock file in root folder and run composer install again.

I just stumbled on this issue. Old laravel projects still work and allow me to do php artisan serve but creating a laravel new mysite gives me the two errors but tells me my site is ready to go and then php artisan serve shows this

bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /bootstrap/autoload.php on line 17

require(): Failed opening required 'bootstrap/../vendor/autoload.php' (include_path='.:') in bootstrap/autoload.php on line 17

I have tried installing composer and moving it then renaming and then reinstalling laravel

when i'm doing laravel new project, it fails to install dependency but the zip is correctly extracted and i can do composer install after deleting composer.lock, it should work for you.

I have the same issue.
Anyone know why this happens?
The screen below shows up when I am trying to run the localhost.
screenshot 56

it's happening because doctrine/inflector requirement is ~1.2 in composer.lock and it needs php 7.0,
just delete composer.lock and run composer install again

@stephenleong as @lk77 already mentioned, delete the composer.lock file and then run composer install.

after doing this check whether there is the .env file. If not , just rename (or copy) the .env.example file and after doing so run the artisan command php artisan key:generate and you should be fine.

I have the same problem
I try to delete composer.lock file in root folder and run composer install again.
but the .env is missing, so I just copy .env.example and create .env

@frezno and @a-komarev, Thanks my laravel website is working now after following your instructions.

Anybody knows when/if this will be fixed?

@frezno solution works. It really should be added to the documentation. @taylorotwell please take a look.

Same problem here.

The files copy across from local to vm but I still get "no input file specified" in the browser. Database does not get created either

Deleting composer.lock and running composer install from inside vm did not work for me although packages did update. The project and database are not recognised with vagrant provision

PHP 5.6.30 macOS

i don't think it's related to this issue, you need to run the migration process to create database, it's not related to installing laravel.

Vagrant provision should create the database. The tables are added with migrations. No database was added this time following the bug encountered.

yes but if something is wrong during install, you need to call migration manually i think.

go to .env file and change APP_DEBUG=true instead of false.

still having this problem after pulling a laravel 5.4.x linux based project over to windows via git. here is my exact error message...

(1/1)聽FatalErrorExceptionClass 'Doctrine\Common\Inflector\Inflector' not found

in聽Pluralizer.php聽(line 66)

tried deleting composer.lock and installing...nope didnt work. I think it is a path issue but I am loath to just copy the files and not fix the underlying issue.

I am fairly new to laravel and would like to get to the bottom of this issue without just kludging a fix.

Hi. For my part I solved this problem whith this following command :
composer config platform.php 7.1.9 (according my php version)

@skududufru thanks a lot! It worked for me. I was inside www folder of wamp64 and had two php versions installed, 5.6.19 and 7.0.4. I kept getting the same error "This package requires php >=7.0 but your PHP version (5.6.19) does not satisfy that requirement". After running the command you posted, I was able to install dependencies. Thanks.

@skududufru : thanks a lots. This solved my issue !!

@skududufru Thanks man you saved my day.

@skududufru thanks! It worked for me.

@skududufru Thank you so much.. you solve my problem :)

@skududufru Thanks! This worked for me.

Generating optimized autoload files

Illuminate\Foundation\ComposerScripts::postAutoloadDump

Parse error: syntax error, unexpected '?' in C:\wamp64\www\oracleshop\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php on line 500

And my php is upgraded to 7.1.9. Anybody knows why might cause this issue?

@konstantin0s there is still an old PHP version lingering around, you need to double check the right one is called

Hello @mfn . Thank you for your reply but I am not sure how to do it. I started wamp server and php7.1.9 is selected. In addition, I added this command line: composer config platform.php 7.1.9.
Any idea?

@konstantin0s create a php page with phpinfo(); and review parameters

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

JamborJan picture JamborJan  路  3Comments

iivanov2 picture iivanov2  路  3Comments

lzp819739483 picture lzp819739483  路  3Comments

fideloper picture fideloper  路  3Comments