On an EE v1.6.8 site running on DreamHost out of no where some of the PHP started throwing an error:
Parse error : syntax error, unexpected…
I haven’t checked with DH yet. I will. But I wanted to put something in play here too.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
March 21, 2012 12:17am
Subscribe [2]#1 / Mar 21, 2012 12:17am
On an EE v1.6.8 site running on DreamHost out of no where some of the PHP started throwing an error:
Parse error : syntax error, unexpected…
I haven’t checked with DH yet. I will. But I wanted to put something in play here too.
#2 / Mar 21, 2012 6:55am
I think you might want to post some more (any) details other nobody is going to be able to help you.
I.e what is the exact error, and are you running PHP inside the affected template, and if so what is it.
What version of PHP might help, though a parse error usually indicates a coding error.
#3 / Mar 21, 2012 7:24am
Thanks DOB -
I appreciate your suggestion but I’m telling you all I know.
The site has been running problem free for a couple years. Now a key line of PHP (mine, not EE’s) is pull an error.
<?php
$date_Start = time()+60*60*24*7*0;
$date_End = time()+60*60*24*8*1;
if (( date('Y-m-d', {event-date}) >= date('Y-m-d', $date_Start)) && ( {event-date} <= $date_End )) {
?>The error is tied to the if statement.
I have an event date. I need the events >= to today and <= 7 days forward. Perhaps there's an EE only (i.e., no PHP) way to do this. I also have another page where I show 7 day to 20 day, 20 days to 30 days, etc.
Note: I could (probably) convince the client to do some sort of paging. If I can figure out an EE way to do {if ({event-date} >= current_sys_date) } then that would be an acceptable workaround.
Any thought?
#4 / Mar 21, 2012 8:28pm
Hi Chiefalchemist,
Typically on a site that’s been running fine and then unexpectedly starts having php errors it’s due to the server being upgraded to a newer version of PHP that no longer supports code that has been deprecated. Could you check with your host and see if your php version has been upgraded recently?
Sean
#5 / Mar 21, 2012 8:42pm
I reckon that’s what it was. But to be honest, the embedded PHP was pretty simple. Perhaps one the date type functions went bad?
I honestly didn’t even try to troubleshoot. I just rethought the problem with knowledge acquired since that development.
Thanks for your help
Mark
p.s. Yes, I’m trying to get the client to upgrade to 2.x.
#6 / Mar 23, 2012 7:50pm
Hi Chief,
If your client doesn’t go for an upgrade to 2.4 then I would strongly encourage move to 1.7.2 so that you are at least on the latest version of the 1.x branch.
Sean
#7 / Mar 24, 2012 1:23pm
Yup. Good point. Thanks again.
#8 / Mar 27, 2012 5:20pm
Hey ChiefAlchemist,
I am glad that Sean could help.
Is there anything else we can help you with?
Cheers,