consistent PHP 5 issue I have. unexpected $end, not sure how to fix

dalearyous

[H]ard|Gawd
Joined
Jun 21, 2008
Messages
1,922
i have done some reading but clearly i do not understand the issue because every attempt to fix fails. i migrated a site down locally and currently using wamp with apache 2.2.17 and php 5.3.4 and i keep receiving this error on numerous pages:

Parse error: syntax error, unexpected $end in C:\wamp\www\website\page_elements\main_nav.php on line x

The line always seems to be the last line of code, usually a closing div tag or something. Any ideas on what I am missing here? I have combed through and looked for the obvious. And the site works fine on PHP 5.0.x ...
 
Like Shockey says .. seems like an incomplete }

I suggest 'breaking up' your code and running it each time to check.. i.e. cutting out sections (irrespective of the final render) to see which section throws an error, then debug that bit.
 
I think it might be incorrect php open tags. I had the same issue moving from php4 to php5 and couldnt figure it out as I had every ; and } in the right place!

It turned out that when ending a php block, returning to html then re-entering php I was using just <? instead of <?php, the first being usable in php4 but not php5

It gave the exact problem you're describing so may be worth checking all your opening php tags are <?php and not just <?

:)
 
Back
Top