Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-13-2009, 04:13 AM   PM User | #1
TheBlueblib
New Coder

 
Join Date: May 2009
Posts: 74
Thanks: 1
Thanked 12 Times in 12 Posts
TheBlueblib is an unknown quantity at this point
Unexpected T_STRING errors

My code's been working virtually flawlessly for over a month, and I suddenly got hit with all these syntax errors - and they make absolutely no sense.
For example, it'll throw me this:
"Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/test.php on line 228"
and line 228 looks like this:
PHP Code:
$cm_test_id $row['cm_test_id']; 
This is only one of the errors, all the other ones seem to be that it suddenly hates single quotes, it threw a syntax error at every GET variable (they looked like this $_GET['test']).

This is the most random group of errors I've ever seen, it's worth mentioning that I restarted Apache before this but hadn't changed the php.ini settings. In case the php.ini file was changed by someone else are there any particular settings worth looking at (for quotes, concatenate, anything syntax etc.)?
TheBlueblib is offline   Reply With Quote
Old 09-13-2009, 04:18 AM   PM User | #2
seco
Regular Coder

 
seco's Avatar
 
Join Date: Nov 2008
Location: Oregon
Posts: 682
Thanks: 5
Thanked 79 Times in 77 Posts
seco has a little shameless behaviour in the past
need to see all the code
seco is offline   Reply With Quote
Old 09-13-2009, 04:25 AM   PM User | #3
zactanaz
New Coder

 
Join Date: Apr 2006
Location: Planet Earth
Posts: 59
Thanks: 1
Thanked 8 Times in 8 Posts
zactanaz is an unknown quantity at this point
Usually these errors are one line before, you may be missing a semicolon or a quote or something of that matter.
zactanaz is offline   Reply With Quote
Old 09-13-2009, 04:29 AM   PM User | #4
TheBlueblib
New Coder

 
Join Date: May 2009
Posts: 74
Thanks: 1
Thanked 12 Times in 12 Posts
TheBlueblib is an unknown quantity at this point
Quote:
Originally Posted by seco View Post
need to see all the code
I can't really post the 400 line code, it wouldn't help anyways. Basically as soon as I temporarily fix one syntax error it finds another one lower down the code. I know I haven't actually mistyped anything (something stupid like forgetting ';') because this code has been working for over a month with no problem. I just had to do a short Apache restart on Ubuntu server (since like 3 months) and there are countless syntax errors - probably spanning 10 php files which have always worked before. So I don't think there's anything wrong with the actual code, more so the php.ini file or some configuration got changed during that time and went into effect as soon as I restarted.

TBH I don't even understand it myself, it's the usual typical T_STRING errors. Here's one that didn't work:
PHP Code:
cm_sess_write('cm_rss'"".$cm_manga."/".$cm_purge_chapter_array[count($cm_purge_chapter_array)-1]."/"); 
The error said it was expecting the ']' but received a '(', so I changed it to this and it worked:
PHP Code:
$cm_purge_chapter_array_count count($cm_purge_chapter_array)-1;
cm_sess_write('cm_rss'"".$cm_manga."/".$cm_purge_chapter_array[$cm_purge_chapter_array_count]."/"); 
It's as if my PHP parser suddenly got really stupid.
TheBlueblib is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:52 PM.


Advertisement
Log in to turn off these ads.