Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Problem with TWG: parse error, unexpected $end
https://www.tinywebgallery.com/forum/viewtopic.php?f=4&t=2753
Page 1 of 1

Author:  DenW [ 20. Oct 2010, 13:29 ]
Post subject:  Problem with TWG: parse error, unexpected $end

Hi,

Thanks for a great script! I've been using it since a couple of versions now without any problem whatsoever.

Recently however, i added my holiday photographs to my server, and made a new installation of TWG because i wanted to keep them separate from my other photo's.
This installation appeared to work equally well, until i shared it with some friends who complained about not being able to see the site.
The error message they received:

Parse error: syntax error, unexpected $end in S:\{...}\webgallery-malaysia\cache\_count_tree_all.tmp.php on line 1

Once a viewer gets this message, all viewers get it (me included).
If i delete this php-file, the gallery returns to normal operation. It seems however that if i open a second session the _count_tree_all.tmp.php file is regenerated, this time with an error in the php file.

Let me share the contents of the (faulty) php-file (ommitting the ? before > and after <, {...} used to abbreviate as above):

<php

$_SESSION["count_treec..\..\..\..\{...}\Vacantie\2010\Maleisiƫ\Den\"] = 1563;

>

The php-file appears to store the picture count for each folder that is displayed in TWG, sometimes it is longer (listing more lines of $_SESSION...) but always stops at the main folder. The script puts all php-commands on 1 line, so hence the error on this particular line.
Although this seems valid php (at least to me), opening it in PSPad shows a syntax problem. Putting a second double quote after the last one restores php syntax and makes the site functional again. However, this file is rewritten with every session that is opened (it seems) and unfortunately the manual correction is nulled.

Can you fix this issue please? Or have i missed something in my search?

Thanks,
DenW

Author:  TinyWebGallery [ 20. Oct 2010, 14:44 ]
Post subject:  Re: Problem with TWG: parse error, unexpected $end

Do you have a " somewhere in your folder names?
can you send me the invalid file by e-mail?

Best,
Michael

Author:  DenW [ 20. Oct 2010, 15:08 ]
Post subject:  Re: Problem with TWG: parse error, unexpected $end

Hi Michael,

Thanks for the quick reply. No, there is no " in the folder names.
Sure, i have the file zipped and ready to send... whereto?

DenW

Author:  TinyWebGallery [ 20. Oct 2010, 15:11 ]
Post subject:  Re: Problem with TWG: parse error, unexpected $end

http://www.tinywebgallery.com/en/about.php

Author:  DenW [ 20. Oct 2010, 15:18 ]
Post subject:  Re: Problem with TWG: parse error, unexpected $end

Ok, thanks.. :)
Mail sent with attachment.

DenW

Author:  TinyWebGallery [ 20. Oct 2010, 15:23 ]
Post subject:  Re: Problem with TWG: parse error, unexpected $end

got it - strange - because normally only / are used an not \ and normally there is no \ at the end.

Which OS do you use fpr the server?

and have you changed $basedir ?

- Michael

Author:  DenW [ 20. Oct 2010, 15:26 ]
Post subject:  Re: Problem with TWG: parse error, unexpected $end

I'm using WinVista (for now) with a WAMP distribution...

Yes, my basedir is:

$basedir="..\\..\\..\\..\\FileShare\\Media\\Pictures\\Vacantie\\2010\\Maleisiƫ\\Den\\";

Author:  TinyWebGallery [ 20. Oct 2010, 15:30 ]
Post subject:  Re: Problem with TWG: parse error, unexpected $end

remove the last \\ after Den.

Normally you can use / for windows systems as well.

- Michael

Author:  DenW [ 20. Oct 2010, 15:34 ]
Post subject:  Re: Problem with TWG: parse error, unexpected $end

ok.. thanks.. i'll try and let you know the results after testing..

I'm using \\ on the other installation as well.. without any problems.. is / preferred?

Thanks for the quick help!
DenW

Author:  TinyWebGallery [ 20. Oct 2010, 15:50 ]
Post subject:  Re: Problem with TWG: parse error, unexpected $end

I think it is because there you have subdirectories there and then the " is not escaped anymore. Because at subdirectories I don't add any // or \.

At basedir no / or \\ are actually allowed at the end because I add this automatically in the script.

And yes / is preferred because it works on windows and unix systems.

- Michael

Author:  DenW [ 21. Oct 2010, 11:44 ]
Post subject:  Re: Problem with TWG: parse error, unexpected $end

Hi Michael,

Deleting the last \\ appears to have solved the problem.

Thanks for your quick replies and an excellent application!
DenW

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/