| Author | Message |
| Post Title: How can I fix it? (IIS USERS READ THIS) | |
xgate32
Joined: May 26, 2003 Posts: 16 Location: Korea, South
|
Posted: Tue Sep 09, 2003 6:43 am
I insert block-NG random in my webpage.
The error message is Parse error: parse error, unexpected T_STRING in d:\apache group\apache\htdocs\blocks\block-NG-random.php on line 31 How can fix it? ---- Give us your Gallery/webserver information to get a faster answer. Get this information from the PHP diagnostic (in the configuration wizard). Gallery URL (optional but very useful): http://21tos.codns.com/modules/gallery Gallery version: 1.4 RC3 Apache version: 1.3.28 PHP version (don't just say PHP 4, please): 4.3.2 Graphics Toolkit: Operating system: Windows XP Professional Web browser/version (if applicable): IE6.0 The CONFIG lines from the top of your block file(s): $GALLERY_BASEDIR = "d:\Apache Group\Apache\htdocs\modules\gallery\"; define(ALBUM_BASEADDR, "http://21tos.codns.com/albums/"); define(SERVER_ADDR, "http://21tos.codns.com/"); |
| Author | Message |
| Post Title: | |
slackbladder
Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Sep 09, 2003 6:58 am
Have you just cut and pasted the CONFIG lines above from your block or re-typed them for this post? I would check for any INVALID characters in line 31.
|
| Author | Message |
| Post Title: | |
slackbladder
Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Sep 09, 2003 7:11 am
Is it the SPACE in you apache path:
d:\Apache Group\Apache\htdocs\modules\gallery\ (Apache Group)? |
| Author | Message |
| Post Title: | |
xgate32
Joined: May 26, 2003 Posts: 16 Location: Korea, South
|
Posted: Tue Sep 09, 2003 8:58 am
Yes. I cut & paste config lines.
I install apache in Windows XP, default path is below d:\Apache Group\Apache\ |
| Author | Message |
| Post Title: | |
xgate32
Joined: May 26, 2003 Posts: 16 Location: Korea, South
|
Posted: Tue Sep 09, 2003 9:20 am
I reinstall Apache d:\Apache
But, result is same.. Problem is not space. |
| Author | Message |
| Post Title: | |
slackbladder
Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Sep 09, 2003 9:24 am
I don't know that much about WinXP/Apache installs - but I'm guess that the problem lays with the SPACE in the server path:
d:\Apache Group\Apache\htdocs\modules\gallery\ That's a 'friendly' filename/path for WINDOWS - but it's a problem for the BLOCK. Have a look at: Installing Apache Q7 here: http://www.johnturner.com/howto/winxp-howto.html |
| Author | Message |
| Post Title: | |
slackbladder
Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Sep 09, 2003 9:26 am
Is it still giving the same error?
Parse error: parse error, unexpected T_STRING in d:\apache group\apache\htdocs\blocks\block-NG-random.php on line 31 |
| Author | Message |
| Post Title: | |
slackbladder
Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Sep 09, 2003 9:50 am
Have you tried:
$GALLERY_BASEDIR = "d:/apache/htdocs/modules/gallery/"; instead? |
| Author | Message |
| Post Title: | |
xgate32
Joined: May 26, 2003 Posts: 16 Location: Korea, South
|
Posted: Tue Sep 09, 2003 10:52 am
I follow your advise.
but result is Warning: Invalid argument supplied for foreach() in d:\apache\htdocs\modules\gallery\session.php on line 63 Warning: main(errors/configure_instructions.php): failed to open stream: No such file or directory in d:\apache\htdocs\modules\gallery\errors\reconfigure.php on line 13 Fatal error: main(): Failed opening required 'errors/configure_instructions.php' (include_path='.;d:\php\includes;d:\php\pear') in d:\apache\htdocs\modules\gallery\errors\reconfigure.php on line 13 |
| Author | Message |
| Post Title: | |
slackbladder
Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Sep 09, 2003 11:00 am
For the error:
Warning: Invalid argument supplied for foreach() in d:\apache\htdocs\modules\gallery\session.php on line 63 Do a search here for 'foreach' - this has been answered before. For the error: Warning: main(errors/configure_instructions.php): At the top of the BLOCK file after the: Code: ›
<? ADD: Code: ›
global $gallery; |
| Author | Message |
| Post Title: | |
xgate32
Joined: May 26, 2003 Posts: 16 Location: Korea, South
|
Posted: Tue Sep 09, 2003 7:56 pm
The Source still remains error.
Plz test in Windows environment. |
| Author | Message |
| Post Title: | |
slackbladder
Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Wed Sep 10, 2003 1:22 am
DARI will have to help you with this one - sry. He's on vaction at the moment - back in a few days.
|
| Author | Message |
| Post Title: Re: How can I fix it? | |
Klinduni
Joined: Oct 29, 2003 Posts: 17
|
Posted: Wed Oct 29, 2003 11:47 pm
Hello. I am receiving the same error as the original poster on this thread [nukedgallery.net] and was wondering if a solution has been presented.
Quote: › Parse error: parse error, unexpected T_STRING in D:\Websites\****\blocks\block-NG-random.php on line 32
My server runs the following:
After reading the forums here, I have learned that I need to add global $gallery; after <?php so I have. The following is my code that generates the error. Code: › <?php
global $gallery; /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Developed by Dariush Molavi at NukedGallery.net * Version 1.0 * 8 August 2003 */ if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) { print "Security violation\n"; exit; } $GALLERY_BASEDIR = "d:\Websites\****\modules\Gallery\"; define(ALBUM_BASEADDR, "http://www.****.com/albums/";); define(SERVER_ADDR, "http://www.****.com/";); require_once($GALLERY_BASEDIR . "init.php"); require_once($GALLERY_BASEDIR . "random_support.php"); define(CACHE_FILE, $gallery->app->albumDir . "/block-random.cache"); define(CACHE_EXPIRED, 86400); /* VALID VALUES FOR $selector: * "DAILY" * "HOURLY" * "RANDOM" */ $selector = "HOURLY"; if($selector=="DAILY"){ $content = daily_photo(); } else if ($selector=="HOURLY"){ $content = hourly_photo(); } else if ($selector=="RANDOM"){ list($album, $index) = get_random_photo_id(); $content = random_photo($album, $index,0); } ?> Originally was receing the same errors as everyone else until I added my full path to the gallery directory. This is hopefully the only error remaining to be resolved. I've done many searches and read the forums here, if I have overlooked a solution I apologize. Any help you can provide would be appreciated. Thanks, Kristin Edited to remove old URL. |
| Author | Message |
| Post Title: | |
slackbladder
Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Thu Oct 30, 2003 5:56 am
Hi,
this: Code: ›
define(ALBUM_BASEADDR, "http://www.induni.com/albums/";); needs to be this: Code: ›
define(ALBUM_BASEADDR, "http://www.induni.com/albums/"); Also this: Code: ›
define(SERVER_ADDR, "http://www.induni.com/";); needs to be this: Code: ›
define(SERVER_ADDR, "http://www.induni.com/"); |
| Author | Message |
| Post Title: | |
dari
Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Thu Oct 30, 2003 7:55 am
you may also have to escape out the backslashes in your path, ie:
Code: ›
$GALLERY_BASEDIR = "d:\\Websites\\induni\\modules\\Gallery\\"; try slackbladder's suggestion first, then this one (ie, not both at the same time) so that we can further assist. |
| Author | Message |
| Post Title: | |
Klinduni
Joined: Oct 29, 2003 Posts: 17
|
Posted: Thu Oct 30, 2003 10:33 am
slackbladder wrote: › Hi,
this: Code: ›
define(ALBUM_BASEADDR, "http://www.****.com/albums/";); needs to be this: Code: ›
define(ALBUM_BASEADDR, "http://www.****.com/albums/"); Also this: Code: ›
define(SERVER_ADDR, "http://www.****.com/";); needs to be this: Code: ›
define(SERVER_ADDR, "http://www.****.com/"); I made these changes and still have the same error. Again my code: Code: › <?php
global $gallery; /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Developed by Dariush Molavi at NukedGallery.net * Version 1.0 * 8 August 2003 */ if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) { print "Security violation\n"; exit; } $GALLERY_BASEDIR = "d:\Websites\****\modules\Gallery\"; define(ALBUM_BASEADDR, "http://www.****.com/albums/"); define(SERVER_ADDR, "http://www.****.com/"); require_once($GALLERY_BASEDIR . "init.php"); require_once($GALLERY_BASEDIR . "random_support.php"); define(CACHE_FILE, $gallery->app->albumDir . "/block-random.cache"); define(CACHE_EXPIRED, 86400); /* VALID VALUES FOR $selector: * "DAILY" * "HOURLY" * "RANDOM" */ $selector = "HOURLY"; if($selector=="DAILY"){ $content = daily_photo(); } else if ($selector=="HOURLY"){ $content = hourly_photo(); } else if ($selector=="RANDOM"){ list($album, $index) = get_random_photo_id(); $content = random_photo($album, $index,0); } ?> dari wrote: › you may also have to escape out the backslashes in your path, ie:
Code: › $GALLERY_BASEDIR = "d:\\Websites\\****\\modules\\Gallery\\";
try slackbladder's suggestion first, then this one (ie, not both at the same time) so that we can further assist. I made the change to escape the \ and get the following error, so I took out the extra \'s and am back where we started. Quote: › Fatal error: Cannot redeclare getnls() (previously declared in d:\Websites\****\modules\Gallery\nls.php:43) in D:\Websites\****\modules\gallery\nls.php on line 42
Thanks for the fast responses guys. ...any other suggestions? |
| Author | Message |
| Post Title: | |
slackbladder
Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Thu Oct 30, 2003 10:41 am
Have you tried changing block-NG-random.php to 'RANDOM' instead of 'HOURLY'?
Does it produce the same error? |
| Author | Message |
| Post Title: | |
Klinduni
Joined: Oct 29, 2003 Posts: 17
|
Posted: Thu Oct 30, 2003 11:52 am
Changed $selector = "HOURLY"; to $selector = "RANDOM";
Still have the same parse error. Quote: › Parse error: parse error, unexpected T_STRING in D:\Websites\****\blocks\block-NG-random.php on line 32
The actual line 32 is: define(ALBUM_BASEADDR, "http://www.DOMAIN.com/albums/"); |
| Author | Message |
| Post Title: | |
dari
Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Thu Oct 30, 2003 12:16 pm
i noticed this: http://gallery.menalto.com/modules.php? ... ws-iis.php
stating that IIS is NOT supported by Gallery. however, we will try to do our best to help you. let me look over your errors and try to figure something out. |
| Author | Message |
| Post Title: | |
dari
Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Thu Oct 30, 2003 12:21 pm
that type of parse error is usually generated because of a problem on the preceding line (no semicolon at the end, etc). however, it looks like yours is ok...my only guess is the pathing of your gallery (the fact that it uses windows, with the backslash, which PHP reserves as an escape character). actually, put the escaped backslashes in there, so that you get the redeclare error, i think i've worked this one out before.
|
| Author | Message |
| Post Title: | |
Klinduni
Joined: Oct 29, 2003 Posts: 17
|
Posted: Thu Oct 30, 2003 4:20 pm
Okay, I placed the backslashes back into line 31. I have the following redeclare error:
Quote: › Fatal error: Cannot redeclare getnls() (previously declared in d:\Websites\****\modules\Gallery\nls.php:43) in D:\Websites\****\modules\gallery\nls.php on line 42
...and yes, Gallery does not support Windows IIS. ... but I have Gallery running in PHP Nuke well, I was just hoping this would work too. If it doesn't it's not a major issue, just no picture from the Gallery on the homepage. Thanks slack and dari for your help. |
| Author | Message |
| Post Title: | |
Klinduni
Joined: Oct 29, 2003 Posts: 17
|
Posted: Fri Oct 31, 2003 1:05 am
Okay, I searched the forums and found that the general solution to a redeclare error has been to use "require_once". Though I'm not sure of the context that should go around the NLS.PHP function to make that work with having the double backslashes in the block page.
|
| Author | Message |
| Post Title: | |
Klinduni
Joined: Oct 29, 2003 Posts: 17
|
Posted: Fri Oct 31, 2003 12:18 pm
Issue fixed for Windows / IIS users who want to use the Random picture block!
Original File contains the following code in the block-NG-random.php file. Code: › $GALLERY_BASEDIR = "/home/httpd/htdocs/modules/gallery/";
Originally I had the full Windows path to the gallery folder as you can see if above code blocks. Most of us know that when using windows you use a \ instead of a / when using pathing. However, this will work if you enter the following: Code: › $GALLERY_BASEDIR = "modules/gallery/";
At least that's all I did and everything is working! Thanks Slack and Dari so very much for your help! |
| Author | Message |
| Post Title: Re: How can I fix it? | |
slackbladder
Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Fri Oct 31, 2003 12:23 pm
Nice one - glad you sorted it. Thx for posting back for other IIS users!
|
| Author | Message |
| Post Title: | |
dari
Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Fri Oct 31, 2003 12:24 pm
great job
|
| Author | Message |
| Post Title: | |
Klinduni
Joined: Oct 29, 2003 Posts: 17
|
Posted: Fri Oct 31, 2003 12:33 pm
Also, in the random_support.php page you must add this
Code: › $count = floatval($count);
in front of: Code: › $choose = rand(1, $count);
Otherwise you will get out of bounds errors occasionally. Hope this helps the few Windows / IIS users out there. |
| Author | Message |
| Post Title: Re: How can I fix it? (IIS USERS READ THIS) | |
newtrend19
Joined: Aug 31, 2010 Posts: 1
|
Posted: Tue Aug 31, 2010 4:27 am
parse error, unexpected T_STRING in d:\apache group\apache\htdocs\blocks\block-NG-random.php on line 31
|