| Author |
Message |
xgate32
Beginner


Joined: May 26, 2003 Posts: 16 Location: Korea, South
|
Posted: Tue Sep 09, 2003 6:43 am Post subject: How can I fix it? (IIS USERS READ THIS) |
|
|
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/"); |
|
| Back to top |
|
|
AdBot
|
| Post subject: How can I fix it? (IIS USERS READ THIS) |
|
|
|
|
|
| Back to top |
|
 |
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Sep 09, 2003 6:58 am Post subject: |
|
|
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. _________________ "The only difference between me and a madman is that I'm not mad." |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Sep 09, 2003 7:11 am Post subject: |
|
|
Is it the SPACE in you apache path:
d:\Apache Group\Apache\htdocs\modules\gallery\
(Apache Group)? _________________ "The only difference between me and a madman is that I'm not mad." |
|
| Back to top |
|
|
xgate32
Beginner


Joined: May 26, 2003 Posts: 16 Location: Korea, South
|
Posted: Tue Sep 09, 2003 8:58 am Post subject: |
|
|
Yes. I cut & paste config lines.
I install apache in Windows XP, default path is below
d:\Apache Group\Apache\ |
|
| Back to top |
|
|
xgate32
Beginner


Joined: May 26, 2003 Posts: 16 Location: Korea, South
|
Posted: Tue Sep 09, 2003 9:20 am Post subject: |
|
|
I reinstall Apache d:\Apache
But, result is same..
Problem is not space. |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Sep 09, 2003 9:24 am Post subject: |
|
|
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 _________________ "The only difference between me and a madman is that I'm not mad." |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Sep 09, 2003 9:26 am Post subject: |
|
|
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 _________________ "The only difference between me and a madman is that I'm not mad." |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Sep 09, 2003 9:50 am Post subject: |
|
|
Have you tried:
$GALLERY_BASEDIR = "d:/apache/htdocs/modules/gallery/";
instead? _________________ "The only difference between me and a madman is that I'm not mad." |
|
| Back to top |
|
|
xgate32
Beginner


Joined: May 26, 2003 Posts: 16 Location: Korea, South
|
Posted: Tue Sep 09, 2003 10:52 am Post subject: |
|
|
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 |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Tue Sep 09, 2003 11:00 am Post subject: |
|
|
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;
_________________ "The only difference between me and a madman is that I'm not mad." |
|
| Back to top |
|
|
xgate32
Beginner


Joined: May 26, 2003 Posts: 16 Location: Korea, South
|
Posted: Tue Sep 09, 2003 7:56 pm Post subject: |
|
|
The Source still remains error.
Plz test in Windows environment. |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Wed Sep 10, 2003 1:22 am Post subject: |
|
|
DARI will have to help you with this one - sry. He's on vaction at the moment - back in a few days.  _________________ "The only difference between me and a madman is that I'm not mad." |
|
| Back to top |
|
|
Klinduni
Beginner


Joined: Oct 29, 2003 Posts: 17
|
Posted: Wed Oct 29, 2003 11:47 pm Post subject: Re: How can I fix it? |
|
|
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\induni\blocks\block-NG-random.php on line 32
My server runs the following:
- Windows 2000 Advanced Server with IIS 5
- PHP Version 4.3.3
- MySQL 3.23.49
- Php-Nuke Version 6.9
- Gallery Version 1.4-pl2
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\induni\modules\Gallery\";
define(ALBUM_BASEADDR, "http://www.induni.com/albums/";);
define(SERVER_ADDR, "http://www.induni.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
Induni.com [induni.com] |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Thu Oct 30, 2003 5:56 am Post subject: |
|
|
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/");
_________________ "The only difference between me and a madman is that I'm not mad." |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6274 Location: Washington Township, NJ, USA
|
|
| Back to top |
|
|
|
|
|
|
|