Page 1 of 1

Laravel parse error

Posted: Tue Apr 21, 2015 11:00 am
by publicGenome
Hi Members,
This is my first thread in this forum.
I'm working on someone else's code, unfortunately, the developer has left and, there are no comments, or documentation in most of the application. I'm trying to set up on my local. I've set required users, mysql tables, tables, granted required permissions to those tables.

my_folder - has everything mysql, laravel, etc.
I do:
localhost/~username/my_folder

In laravel logs file I get
[2015-04-21 15:40:20] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'parse error' in /Users/username/Sites/folder_/public/includes/sql.inc.php:21
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleShutdown()
#1 {main} [] []
At sql.inc.php, line 21 I've something like:

Code: Select all

    if(empty($result)) {
        	 yield [];
        }
My machine specs:

- Mac OSX 10.9
- PHP version 5.4
- Apache details: Server version: Apache/2.2.26 (Unix)
- Have Laravel installed and in my path.
Laravel version: 5.0.27

- Eclipse PDT, with zend debugger installed.

I've no experience in whatsoever with respect to web development- PHP, CSS, mysql.
I'd be thankful to members for any guidance and help in this.

Re: Laravel parse error

Posted: Tue Apr 21, 2015 11:07 am
by Weirdan
You need more recent php version. Generators (yield) are supported starting from php 5.5

Re: Laravel parse error

Posted: Tue Apr 21, 2015 11:11 am
by publicGenome
Oh is it?
I shall get back as soon as I fix PHP version :)
Thank you

Re: Laravel parse error

Posted: Tue Apr 21, 2015 11:58 am
by publicGenome
This was the Key. Got version 5.5, application seems to Yield in. :D
Thanks Weirdan.!
Weirdan wrote:You need more recent php version. Generators (yield) are supported starting from php 5.5