Laravel parse error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
publicGenome
Forum Contributor
Posts: 110
Joined: Thu Apr 16, 2015 7:55 am

Laravel parse error

Post 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.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Laravel parse error

Post by Weirdan »

You need more recent php version. Generators (yield) are supported starting from php 5.5
publicGenome
Forum Contributor
Posts: 110
Joined: Thu Apr 16, 2015 7:55 am

Re: Laravel parse error

Post by publicGenome »

Oh is it?
I shall get back as soon as I fix PHP version :)
Thank you
publicGenome
Forum Contributor
Posts: 110
Joined: Thu Apr 16, 2015 7:55 am

Re: Laravel parse error

Post 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
Post Reply