Connecting Tech Pros Worldwide Forums | Help | Site Map

Parse error

Stuart Rogers
Guest
 
Posts: n/a
#1: Jul 17 '05
I have just setup my website with a new linux hosting service. I have
copied over my scripts and the jpgraph (the stable version) files from my
working local lan linux server. The hosting service runs PHP 4.3.9 and I
keep getting parse errors like this-

Parse error: parse error, unexpected '=' in
/home/fhlinux199/s/mydomain.org.uk/user/htdocs/jpgraph/jpgraph.php on line
1100

when I look at the content of jpgraph.php it is just fine

$valid_formats = array('png', 'jpg', 'gif');

prior to this it gave me a similar error with an invalid single quote at

$this_>background_image = $aFileName;

Anyone any ideas?

Stuart

denisb
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Parse error


Stuart Rogers <me@privacy.net> wrote:[color=blue]
> when I look at the content of jpgraph.php it is just fine
> $valid_formats = array('png', 'jpg', 'gif');
> prior to this it gave me a similar error with an invalid single quote at
> $this_>background_image = $aFileName;[/color]
........^

typo ?

$this->background_image = $aFileName;

--
@@@@@
E -00 comme on est very beaux dis !
' `) /
|\_ =="
Stuart Rogers
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Parse error


newdb@no-log.org (denisb) wrote in news:1gsnolw.1yvucpyutfv6wN%newdb@no-
log.org:
[color=blue]
> Stuart Rogers <me@privacy.net> wrote:[color=green]
>> when I look at the content of jpgraph.php it is just fine
>> $valid_formats = array('png', 'jpg', 'gif');
>> prior to this it gave me a similar error with an invalid single quote at
>> $this_>background_image = $aFileName;[/color]
> .......^
>
> typo ?
>
> $this->background_image = $aFileName;
>[/color]

No this is exactly as jpgraph.php line 1110 downloads and runs on my linux
server, there is nothing wrong with either of these lines at all. As I said
the code runs EXACTLY asis on one server but not on another
denisb
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Parse error


Stuart Rogers <me@privacy.net> wrote:[color=blue]
> newdb@no-log.org (denisb) wrote in news:1gsnolw.1yvucpyutfv6wN%newdb@no-
> log.org:[color=green]
> > Stuart Rogers <me@privacy.net> wrote:[color=darkred]
> >> when I look at the content of jpgraph.php it is just fine
> >> $valid_formats = array('png', 'jpg', 'gif');
> >> prior to this it gave me a similar error with an invalid single quote at
> >> $this_>background_image = $aFileName;[/color]
> > .......^
> >
> > typo ?
> >
> > $this->background_image = $aFileName;[/color]
> No this is exactly as jpgraph.php line 1110 downloads and runs on my linux
> server, there is nothing wrong with either of these lines at all. As I said
> the code runs EXACTLY asis on one server but not on another[/color]

ok.
in mine (v 1.242.2.96) :

....
1090 $valid_formats = array('png', 'jpg', 'gif');
1091 $aImgFormat = strtolower($e[count($e)-1]);
....
1100 $this->background_image = $aFileName;
1101 $this->background_image_type=$aBgType;
1102 $this->background_image_format=$aImgFormat;
1103 }
....

--
@@@@@
E -00 comme on est very beaux dis !
' `) /
|\_ =="
Stuart Rogers
Guest
 
Posts: n/a
#5: Jul 17 '05

re: Parse error


newdb@no-log.org (denisb) wrote in
news:1gsnsvs.hi8qbe1olc2sgN%newdb@no-log.org:
[color=blue]
> Stuart Rogers <me@privacy.net> wrote:[color=green]
>> newdb@no-log.org (denisb) wrote in
>> news:1gsnolw.1yvucpyutfv6wN%newdb@no- log.org:[color=darkred]
>> > Stuart Rogers <me@privacy.net> wrote:
>> >> when I look at the content of jpgraph.php it is just fine
>> >> $valid_formats = array('png', 'jpg', 'gif');
>> >> prior to this it gave me a similar error with an invalid single
>> >> quote at $this_>background_image = $aFileName;
>> > .......^
>> >
>> > typo ?
>> >
>> > $this->background_image = $aFileName;[/color]
>> No this is exactly as jpgraph.php line 1110 downloads and runs on my
>> linux server, there is nothing wrong with either of these lines at
>> all. As I said the code runs EXACTLY asis on one server but not on
>> another[/color]
>
> ok.
> in mine (v 1.242.2.96) :
>
> ...
> 1090 $valid_formats = array('png', 'jpg', 'gif');
> 1091 $aImgFormat = strtolower($e[count($e)-1]);
> ...
> 1100 $this->background_image = $aFileName;
> 1101 $this->background_image_type=$aBgType;
> 1102 $this->background_image_format=$aImgFormat;
> 1103 }
> ...
>[/color]

That is exactly what I have in the same version just downloaded from the
jpgraph website today and installed on my hosting site and I still get
the errors.

I think this is something to do with a setting on PHP and not to do with
jpgraph at all. I thought I read somewhere about a problem if the php.ini
file has the short prefix on but I cant find it now....

Also as this is on a hosting site I cant see the php.ini file!

Stuart
Stuart Rogers
Guest
 
Posts: n/a
#6: Jul 17 '05

re: Parse error


Stuart Rogers <me@privacy.net> wrote in
news:Xns960AD9FD81507stuartfreenews@130.133.1.4:
[color=blue]
> newdb@no-log.org (denisb) wrote in
> news:1gsnsvs.hi8qbe1olc2sgN%newdb@no-log.org:
>[color=green]
>> Stuart Rogers <me@privacy.net> wrote:[color=darkred]
>>> newdb@no-log.org (denisb) wrote in
>>> news:1gsnolw.1yvucpyutfv6wN%newdb@no- log.org:
>>> > Stuart Rogers <me@privacy.net> wrote:
>>> >> when I look at the content of jpgraph.php it is just fine
>>> >> $valid_formats = array('png', 'jpg', 'gif');
>>> >> prior to this it gave me a similar error with an invalid single
>>> >> quote at $this_>background_image = $aFileName;
>>> > .......^
>>> >
>>> > typo ?
>>> >
>>> > $this->background_image = $aFileName;
>>> No this is exactly as jpgraph.php line 1110 downloads and runs on my
>>> linux server, there is nothing wrong with either of these lines at
>>> all. As I said the code runs EXACTLY asis on one server but not on
>>> another[/color]
>>
>> ok.
>> in mine (v 1.242.2.96) :
>>
>> ...
>> 1090 $valid_formats = array('png', 'jpg', 'gif');
>> 1091 $aImgFormat = strtolower($e[count($e)-1]);
>> ...
>> 1100 $this->background_image = $aFileName;
>> 1101 $this->background_image_type=$aBgType;
>> 1102 $this->background_image_format=$aImgFormat;
>> 1103 }
>> ...
>>[/color]
>
> That is exactly what I have in the same version just downloaded from
> the jpgraph website today and installed on my hosting site and I still
> get the errors.
>
> I think this is something to do with a setting on PHP and not to do
> with jpgraph at all. I thought I read somewhere about a problem if the
> php.ini file has the short prefix on but I cant find it now....
>
> Also as this is on a hosting site I cant see the php.ini file!
>
> Stuart
>[/color]

Forgot that phpinfo shows the .ini settings and short tag is on on
hosting site.

One thing I have found is that if I edit the line by replacing the code
with the same code it complains about an earier line in the same file,
edit that line and it then complains about an earlier line.... just dont
understand it!
denisb
Guest
 
Posts: n/a
#7: Jul 17 '05

re: Parse error


Stuart Rogers <me@privacy.net> wrote:[color=blue]
> One thing I have found is that if I edit the line by replacing the code
> with the same code it complains about an earier line in the same file,
> edit that line and it then complains about an earlier line.... just dont
> understand it![/color]

only in SetBackgroundImage() function ?
[color=blue]
> That is exactly what I have in the same version just downloaded from
> the jpgraph website today and installed on my hosting site and I still
> get the errors.[/color]

a problem with the gd library version (different on each server) ?

--
@@@@@
E -00 comme on est very beaux dis !
' `) /
|\_ =="
Janwillem Borleffs
Guest
 
Posts: n/a
#8: Jul 17 '05

re: Parse error


Stuart Rogers wrote:[color=blue]
> One thing I have found is that if I edit the line by replacing the
> code with the same code it complains about an earier line in the same
> file, edit that line and it then complains about an earlier line....
> just dont understand it![/color]

Scan your code for incomplete lines (missing semi-colons).

The following might also be useful:

http://www.php.net/manual/en/functio...eck-syntax.php


JW



Stuart Rogers
Guest
 
Posts: n/a
#9: Jul 17 '05

re: Parse error


newdb@no-log.org (denisb) wrote in news:1gso2s4.f1ie7i1f39rkoN%newdb@no-
log.org:
[color=blue]
> Stuart Rogers <me@privacy.net> wrote:[color=green]
>> One thing I have found is that if I edit the line by replacing the code
>> with the same code it complains about an earier line in the same file,
>> edit that line and it then complains about an earlier line.... just dont
>> understand it![/color]
>
> only in SetBackgroundImage() function ?[/color]

So far yes
[color=blue]
>[color=green]
>> That is exactly what I have in the same version just downloaded from
>> the jpgraph website today and installed on my hosting site and I still
>> get the errors.[/color]
>
> a problem with the gd library version (different on each server) ?
>[/color]

Why would that give me a PHP parse error?
Stuart Rogers
Guest
 
Posts: n/a
#10: Jul 17 '05

re: Parse error


"Janwillem Borleffs" <jw@jwscripts.com> wrote in news:4222551b$0$70623
$dbd41001@news.euronet.nl:
[color=blue]
> Stuart Rogers wrote:[color=green]
>> One thing I have found is that if I edit the line by replacing the
>> code with the same code it complains about an earier line in the same
>> file, edit that line and it then complains about an earlier line....
>> just dont understand it![/color]
>
> Scan your code for incomplete lines (missing semi-colons).
>[/color]
Presumably the php -l would report if I had any and it did not.
[color=blue]
> The following might also be useful:
>
> http://www.php.net/manual/en/functio...eck-syntax.php
>[/color]
I ran the code through the commandline and got no errors at all, but not
on the hosting site, dont have access for that.
Anthony Houghton
Guest
 
Posts: n/a
#11: Jul 17 '05

re: Parse error


[color=blue]
> One thing I have found is that if I edit the line by replacing the code
> with the same code it complains about an earier line in the same file,
> edit that line and it then complains about an earlier line.... just dont
> understand it![/color]

Almost sounds like it is taking everything to the right of a equals sign
earlier in your code as a continuous string, at least up until the edit.

Is it a Unix/Windows/Mac line ending problem? Sp when you edit it, the line
ending is corrected?

Search Me.
--
Ant


Closed Thread