Skip to content
This repository has been archived by the owner on Sep 13, 2019. It is now read-only.

Parse Error #44

Closed
vmitchell85 opened this issue Jun 23, 2017 · 8 comments
Closed

Parse Error #44

vmitchell85 opened this issue Jun 23, 2017 · 8 comments

Comments

@vmitchell85
Copy link

I'm getting an interesting error in my logs.

[2017-06-23 17:19:00] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'parse error, expecting `';'' or `'{''' in /PATHTOAPPLICATION/vendor/spatie/laravel-migrate-fresh/src/Commands/MigrateFresh.php:59
Stack trace:
#0 {main}  

The line in question: https://github.com/spatie/laravel-migrate-fresh/blob/master/src/Commands/MigrateFresh.php#L59

The things that make this error interesting:

  1. It shows up only in the laravel.log file
  2. The command works fine when ran
  3. It seems to show up in the log every time the scheduler is ran from crontab (every minute)
  4. I setup a new laravel installation and pulled in only this package and it does show the error

It seems to have something to do with the return type. If I remove the return type it works fine.

@freekmurze
Copy link
Member

Are you sure you're running PHP 7 on the CLI?

@vmitchell85
Copy link
Author

vmitchell85 commented Jun 23, 2017

Sorry... forgot to mention that.. I'm running 7.1.5

image

@freekmurze
Copy link
Member

freekmurze commented Jun 23, 2017

Are you 100% sure of that? Could you test that on the cli? I'm sorry for asking again, but I've had issues where people thought that web php version === cli php version, and that's not always the case.

@vmitchell85
Copy link
Author

Step to reproduce (I think):

  1. New Laravel App
  2. Install & Setup Package
  3. Setup crontab to the scheduler

* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1

@freekmurze
Copy link
Member

freekmurze commented Jun 23, 2017

Must be something specific to your app/server. I've got this package installed in multiple production sites that have schedule:run scheduled. I checked in the logs of some of that just now and I don't see that message you're reporting.

If you find out what is causing it, please report it here. Kinda curious what the problem is.

@vmitchell85
Copy link
Author

This happens with a new Laravel Install on my local Mac using Valet.

I wonder if crontab is not running the same php version terminal is showing...

@vmitchell85
Copy link
Author

Yep... crontab isn't running the same php version... I'll fix that... sorry to waste your time...

@freekmurze
Copy link
Member

freekmurze commented Jun 23, 2017 via email

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

No branches or pull requests

2 participants