Forums / Installing on a Windows Server / ADMIN page wont load at all! (Windows Bug in PHP 5.2.4)

ADMIN page wont load at all! (Windows Bug in PHP 5.2.4)

Views: 19,366

Results 21 to 31 of 31
18 Sep 2007, 7:44 PM
#21
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

ADMIN page wont load at all! (Windows Bug in PHP 5.2.4)

SkipperMcNally:

**After digging, this is a PHP 5.2.4 Windows bug with a patch available in CVS:
http://bugs.php.net/bug.php?id=42523
**

Woot! -- Thanks for digging that up.
I guess we'll just have to hope that the next PHP version fixes it properly.
I'm not planning to make any changes to Zen Cart to accommodate this PHP bug. Will simply be instructing to upgrade PHP.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Sep 2007, 1:08 AM
#22
shanescy avatar

shanescy

New Zenner

Join Date:
Sep 2007
Location:
Saint Albans, WV 25177
Posts:
4
Plugin Contributions:
0

Re: ADMIN page wont load at all! (Windows Bug in PHP 5.2.4)

the patch works "IT WORKS" Woooo Hooo :clap::clap::clap::clap::clap::clap::clap:

3 Dec 2007, 7:25 PM
#23
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: ADMIN page wont load at all! (Windows Bug in PHP 5.2.4)

Hi,
I was using PHP 5.25 and the bug appeared to be still there (it was fixed in 5.25)

ie. using the test script

<?php echo $_SERVER['PHP_SELF']; ?>

returns the double path

/catalog/admin/test.php/catalog/admin/test.php

which is the symptom of the bug and stops the admin page from loading.

However it was a fault with the Abyss web server I am using for development:
In Scripting Parameters, edit the Interpreter entry and change the Type
field from 'PHP Style' to 'Standard'.
http://bugs.php.net/bug.php?id=43247&edit=2
regards
Steve

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

15 Jan 2008, 11:19 PM
#24
randallj2877 avatar

randallj2877

New Zenner

Join Date:
Jan 2008
Posts:
8
Plugin Contributions:
0

Re: ADMIN page wont load at all! (Windows Bug in PHP 5.2.4)

After digging, this is a PHP 5.2.4 Windows bug with a patch available in CVS: http://bugs.php.net/bug.php?id=42523

For those of you running PHP 5.2.4 on Windows who, for whatever reason, are not able to patch this (perhaps because you don;t own your own server, and your web hosting provider will not patch the PHP bug for you -- like me!!), I coded a workaround that accommodates PHP with and without the patch.

First, locate application_top.php in /admin/includes/. Search for the code block in that file that looks something like this (if memory serves me, because I've already altered my code):

// set php_self in the local scope
if (!isset($PHP_SELF)) 
    $PHP_SELF = $_SERVER['PHP_SELF'];

Then modify this code as follows:

// set php_self in the local scope
if (!isset($PHP_SELF)) 
{
	if (substr_count($_SERVER['PHP_SELF'],'.') > 1)
	{
		$pathArr = explode('/',$_SERVER['PHP_SELF']);
		$truePathArrCount = (count($pathArr) - 1) / 2;
		for ($i=1; $i<=$truePathArrCount; $i++)
		{
			$newPathArr[] = $pathArr[$i];
		}
		if (is_array($newPathArr))
		{
			$PHP_SELF = '/' . implode('/',$newPathArr);
		}
	}
	else
	{
		$PHP_SELF = $_SERVER['PHP_SELF'];
	}
}

Volia, the Admin page no longer hangs forever and you can log into the Admin area successfully.

21 Mar 2008, 5:23 PM
#25
confuseduk avatar

confuseduk

New Zenner

Join Date:
Mar 2008
Posts:
10
Plugin Contributions:
0

Re: ADMIN page wont load at all! (Windows Bug in PHP 5.2.4)

doesnt seem to work for me, still get the same double name
if anyone has a resolution for this it would be good.

15 Jun 2008, 8:32 AM
#26
gardenpondcenter avatar

gardenpondcenter

New Zenner

Join Date:
Nov 2007
Posts:
3
Plugin Contributions:
0

Re: ADMIN page wont load at all! (Windows Bug in PHP 5.2.4)

randallj2877 ~~ Thanks so much for solving this issue for us!!! It has been driving me nuts for almost an hour! I googled all over for it, "zencart admin redirect loop" and couldn't find anything. After enough variations I found a link to this thread and you had the answer. Phew. What a hassle. Silly PHP 5.2.4! Again, thanks so much for your help.

10 Apr 2010, 2:25 AM
#27
vincentd avatar

vincentd

New Zenner

Join Date:
Apr 2010
Posts:
5
Plugin Contributions:
0

Re: ADMIN page wont load at all! (Windows Bug in PHP 5.2.4)

randallj2877:

For those of you running PHP 5.2.4 on Windows who, for whatever reason, are not able to patch this (perhaps because you don;t own your own server, and your web hosting provider will not patch the PHP bug for you -- like me!!), I coded a workaround that accommodates PHP with and without the patch.

First, locate application_top.php in /admin/includes/. Search for the code block in that file that looks something like this (if memory serves me, because I've already altered my code):

// set php_self in the local scope
if (!isset($PHP_SELF))
$PHP_SELF = $_SERVER['PHP_SELF'];

> 
> Then modify this code as follows:
> 
> ```php
// set php_self in the local scope
if (!isset($PHP_SELF)) 
{
	if (substr_count($_SERVER['PHP_SELF'],'.') > 1)
	{
		$pathArr = explode('/',$_SERVER['PHP_SELF']);
		$truePathArrCount = (count($pathArr) - 1) / 2;
		for ($i=1; $i<=$truePathArrCount; $i++)
		{
			$newPathArr[] = $pathArr[$i];
		}
		if (is_array($newPathArr))
		{
			$PHP_SELF = '/' . implode('/',$newPathArr);
		}
	}
	else
	{
		$PHP_SELF = $_SERVER['PHP_SELF'];
	}
}

Volia, the Admin page no longer hangs forever and you can log into the Admin area successfully.

HOLY CRAP, you are a god. This fixed it for me! Thank the lord, I've been trying to resolve this for HOURS. Although, I am on a Linux server.

10 Apr 2010, 3:53 AM
#28
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: ADMIN page wont load at all! (Windows Bug in PHP 5.2.4)

VincentD:

HOLY CRAP, you are a god. This fixed it for me! Thank the lord, I've been trying to resolve this for HOURS. Although, I am on a Linux server.
If you're running the PHP version that contains the bug ... then I suggest you get your PHP version fixed ASAP, since it's VERY old.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

1 May 2010, 10:11 PM
#29
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: ADMIN page wont load at all! (Windows Bug in PHP 5.2.4)

Greetings;

I was getting the same error with the white page in the admin, the way i fixed it was by changing the premissions on the file

/public_html/includes/configure.php

As soon as i set that to (644) the admin section started working.

19 May 2011, 8:07 AM
#30
piko avatar

piko

New Zenner

Join Date:
May 2011
Posts:
2
Plugin Contributions:
0

Re: ADMIN page wont load at all! (Windows Bug in PHP 5.2.4)

Thank You randallj2877! :clap:
I tried manually installing zen cart, but godaddy gave me a server error during the last step of the installation. So then I tried installing the app through godaddy. I was warned through the reviews that godaddy's zen cart app installation was faulty, but I didn't want to manually install it again (did it twice). So here I am trying to find a solution to the admin login page. Good thing I stumbled upon this post!

19 May 2011, 4:18 PM
#31
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: ADMIN page wont load at all! (Windows Bug in PHP 5.2.4)

I repeat:> DrByte:

If you're running the PHP version that contains the bug ... then I suggest you get your PHP version fixed ASAP, since it's VERY old.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.