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:
- you go to admin, (by this time your working directory is changed to admin )
- then open up index.php
- the index.php will import the files under the admin directory
- 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.
- 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
- 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