Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error creating a new project using PHP Version < 7.0 #20214

Closed
rkgarcia opened this issue Jul 22, 2017 · 30 comments
Closed

Error creating a new project using PHP Version < 7.0 #20214

rkgarcia opened this issue Jul 22, 2017 · 30 comments

Comments

@rkgarcia
Copy link

  • 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.

@lk77
Copy link

lk77 commented Jul 22, 2017

Hello,

when I’m 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

@aaronguostudio
Copy link

I have the save problem.

@antonkomarev
Copy link
Contributor

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

@amc123-glitch
Copy link

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

@lk77
Copy link

lk77 commented Jul 23, 2017

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.

@stephenleong
Copy link

stephenleong commented Jul 23, 2017

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

@lk77
Copy link

lk77 commented Jul 23, 2017

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

@frezno
Copy link

frezno commented Jul 23, 2017

@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.

@mikamurar
Copy link

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

@rajeshstarlite
Copy link

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

@istratos
Copy link

Anybody knows when/if this will be fixed?

@themsaid
Copy link
Member

handled here #20227

@weidmaster
Copy link

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

@xlcrr
Copy link

xlcrr commented Jul 27, 2017

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

@lk77
Copy link

lk77 commented Jul 27, 2017

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.

@xlcrr
Copy link

xlcrr commented Jul 27, 2017

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

@lk77
Copy link

lk77 commented Jul 27, 2017

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

@Jitendrap67
Copy link

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

@menriquez
Copy link

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.

@thomas-latterner
Copy link

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

@andrewf137
Copy link

@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.

@sondang86
Copy link

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

@ahmedwaleed1
Copy link

@skududufru Thanks man you saved my day.

@EmersonRomao
Copy link

@skududufru thanks! It worked for me.

@ruseltayongski
Copy link

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

@carlitosz
Copy link

@skududufru Thanks! This worked for me.

@konstantin0s
Copy link

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?

@mfn
Copy link
Contributor

mfn commented Dec 22, 2018

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

@konstantin0s
Copy link

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?

@rkgarcia
Copy link
Author

rkgarcia commented Dec 22, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests