[PHP] parse error, unexpected $

2004-02-10 Thread Bruno Mattarollo
Hello,

I am having a strange problem with PHP and I can't really find a proper 
answer, maybe someone have seen this before and can give me a hint.

I have a series of files (originally developed by another colleague) 
installed on a server with PHP 4.2.2 and I get this error:

Parse error: parse error, unexpected $ in 
/var/www/html/donation/installations/gpi/form.inc on line 528

Line 528 is actually the last line on that file, it's an empty line. 
Tried removing, adding spaces, and the number of lines change, always 
pointing to the last line. Checking online, I get similar comments from 
people when braces are unbalanced, i.e. a "while" loop that doesn't 
have a closing "}". I have checked this file with Zend Studio for 
correctness and there is no problem, checked every block, all closed. 
Checked all the included files as well ...

The strange thing as well is that this runs on my laptop, running PHP 
4.3.4 and doesn't return any errors. Has anyone seen this? Where can I 
find the differences in syntax between these two PHP versions, maybe 
that's the cause...? I also looked at the possibility that it's the 
"short_open_tag" in the configuration file but it seems like the option 
is properly set in the httpd.conf file on pluto.greenpeace.com ... I am 
a bit lost now, any suggestions?

/B

--
Bruno Mattarollo <[EMAIL PROTECTED]>
Head of IT - Greenpeace International
[ http://www.greenpeace.org/ ]


PGP.sig
Description: This is a digitally signed message part


Re: [PHP] parse error, unexpected $

2004-02-11 Thread Bruno Mattarollo
Hello Raditha and all,

Thanks for the replies ... I reviewed all my code with Zend Studio and 
the syntax was correct everywhere ... so I tried running the 
application from the command line:

$ php donate.php

and it worked fine, so looking through the code we saw that there was a 
"short-tag" in one place and that was the problem since the 
"short-tags" is off on the server (Apache) as we also process 
(read/write/etc) XML files ...

Anyways, thanks for the replies :)

/B

On Feb 10, 2004, at 16:38, Raditha Dissanayake wrote:

The line number is misleading the error is generally above the line 
that's reffered to. try commenting out sections of the code. If you 
have an IDE it will be able to point out the error. If you don't have 
an IDE some text editor that is capable of syntax highlighting will 
also help.

--
Bruno Mattarollo <[EMAIL PROTECTED]>
Head of IT - Greenpeace International
[ http://www.greenpeace.org/ ]


PGP.sig
Description: This is a digitally signed message part