Issues with prototyping my database. Syntax error in auto-generated bake file.

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Issues with prototyping my database. Syntax error in auto-generated bake file.


I am currently working on a project in CakePHP, the project is a web based theater ticket manager.

My issue resides in baking database tables I have developed using the phpMyAdmin tool on a WampServer.

I believe I have followed the CakePHP syntax for naming database tables and fields (i.e. do not use capital letters, separate words with underscores).

I have navigated to the root of the development directory and I run the traditional bake commands, in this case the database table I am trying to bake is called "tickets", residing in a database called "theater_ticket_manager_db", although the error occurs for every table I try to bake.

I run the command bin\cake bake all tickets and I get the following error:

Parse error: syntax error, unexpected 'foreach' (T_FOREACH) in C:\wamp\...\code\tmp\bake\Bake-Model-Table-ctp.php on line 179

Followed by a stack trace. In addition, there are two errors associated with hyphens on lines 179 and 182.

If it is necessary, I will post the Bake-Model-Table-ctp.php file, but as this is a file generated by the bake I am assuming at this point that the file itself is not the issue.

Here is some version information:

  • PHP: 5.5.12
  • Apache: 2.4.9
  • MySQL: 5.6.17
  • CakePHP: 3.2

Has anyone else run into this issue or have an idea of what I should look for?

Thanks ahead of time!

Like Us on FaceBook
Find us on Twitter

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at
For more options, visit