Zen Cart Logo
Forums / Bug Reports / [Not a ZC Bug] Automatically redirected to admin/installation folder

[Not a ZC Bug] Automatically redirected to admin/installation folder

Locked

Views: 1,638

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
26 Oct 2007, 01:19
#1
jaycode avatar

jaycode

Zen Follower

Join Date:
Jun 2007
Location:
Australia - Melbourne
Posts:
306
Plugin Contributions:
1

[Not a ZC Bug] Automatically redirected to admin/installation folder

I recently found this bug when working on a client's site with these parameters (you can check these status by creating a <?php phpinfo(); ?> file:

SERVER_SOFTWARE: Microsoft-IIS/6.0
PHP VERSION: 5.2.4.

It is not actually the bug of Zen-Cart, but rather the IIS itself, I've never found this problem with Apache Server.


I. Technical Description (Warning, might sound too technical,
maybe you want to jump this part and go to next part instead.)

The problem was the website will automatically change its working directory when you go to different folders in the website, say:

  1. you go to admin, (by this time your working directory is changed to admin )
  2. then open up index.php
  3. the index.php will import the files under the admin directory
  4. some of the files inside application_top.php wont be loaded, then it will open up your installation folder, thinking you haven't installed properly.
  5. If you already removed / renamed your installation folder, php will cancel that request and get back to the root folder, which now has been changed to admin folder.

II. How to Solve

  1. I added these lines of code in index.php:

chdir("D:/Inetpub/[YOUR_WEBSITE_FOLDER]/admin");
chdir("../");

It may look lousy, but yeap I used a workaround to access the website folder, which was by going to admin folder first then go up one level.

Good Luck,

Jaycode

26 Oct 2007, 21:53
#2
millerjd avatar

millerjd

New Zenner

Join Date:
Jun 2007
Posts:
14
Plugin Contributions:
0

Re: [Not a ZC Bug] Automatically redirected to admin/installation folder

Great post. Exactly our problem with PHP5.2.4/IIS6.0. We had the hosting company rollback the PHP version since we didn't want to take any further chances.

I believe this bug is more with PHP than IIS. Previous versions work with II6.0 just fine, only 5.2.4 is causing the issue.

Or it may be a combination since this issue so far doesn't exist with Apache

27 Oct 2007, 07:31
#3
jaycode avatar

jaycode

Zen Follower

Join Date:
Jun 2007
Location:
Australia - Melbourne
Posts:
306
Plugin Contributions:
1

Re: [Not a ZC Bug] Automatically redirected to admin/installation folder

millerjd:

Great post. Exactly our problem with PHP5.2.4/IIS6.0. We had the hosting company rollback the PHP version since we didn't want to take any further chances.

Thanks, you're right, the best thing to do is rolling back, at least until they came up with a better, more stabile version. The workaround I did just as what it was, a workaround.

millerjd:

I believe this bug is more with PHP than IIS. Previous versions work with II6.0 just fine, only 5.2.4 is causing the issue.

Or it may be a combination since this issue so far doesn't exist with Apache

Interesting, I agree with that.