Re: Fresh install admin access fails with too many redirects
1. It's a bug.
2. It's an attempt to integrate the logic for fix_cache_key into core so people don't need to run that separate util if they switch servers.
3. This is what it was doing:
- if the directory named by SESSION_WRITE_DIRECTORY doesn't exist, it was detecting what folder the script was running in so that it could guess what the correct "store root" was, and then appending /cache to it (since if the one in the db didn't exist then the best guess after that is /cache). The bug is that the file doing the detection is 2 levels under the admin folder, and thus was *incorrectly* guessing that it needed to use /admin/includes/ instead of just /
It's easy to avoid encountering the bug:
- create the /cache folder (or any other writable folder)
- set SESSION_WRITE_DIRECTORY to point to it
The fix to have it guess the correct /cache folder is to change the file I mentioned above, and alter the realpath(dirname(__FILE)) to be realpath(dirname($_SERVER['SCRIPT_FILENAME'])) .... but the redirect will still happen if you don't actually have the /cache folder.
But I'm reluctant to commit a code fix for the above, because I'm wondering if the original need for this has maybe expired, and even using fix_cache_key may no longer be necessary, given that sessions are now only stored in the database, not the filesystem.
Further research is required to determine the optimum solution.
Re: Fresh install admin access fails with too many redirects
What if you just set the default value for SESSION_WRITE_DIRECTORY in the mysql script to DIR_FS_CATALOG/cache? That exists.
Re: Fresh install admin access fails with too many redirects
Will consider it.
It's just strange that in all the testing we've done with multiple environments and upgrades we never triggered this issue.
Re: Fresh install admin access fails with too many redirects
ok. I created the known bugs in 1.5.3 thread and added a pointer to this thread.
1 Attachment(s)
Re: Fresh install admin access fails with too many redirects
Here's a replacement file which should resolve the issue:
Simply unzip and upload to your server as /admin/includes/init_includes/init_cache_key_check.php
THIS FILE SHOULD ONLY BE USED ON ZC v1.5.3. .... DO NOT put it on any other version!
Re: Fresh install admin access fails with too many redirects
I wonder if the issue is that the /cache folder by default isn't writable. Could the installer check this condition and block progress as it does with configure.php files?
Re: Fresh install admin access fails with too many redirects
Quote:
Originally Posted by
swguy
I wonder if the issue is that the /cache folder by default isn't writable. Could the installer check this condition and block progress as it does with configure.php files?
It does already point out that the folder isn't writable when running zc_install, on the System Inspection page.
Re: Fresh install admin access fails with too many redirects
Hello there,
I originally posted here, when I first noticed the error it was a blank page, and then I went to 1.5.4 and it was 'too many redirects' on admin.
http://www.zen-cart.com/showthread.p...ht=blank+admin
I am going crazy here, lol. I have found this thread and can see there must be something wrong with my setup. I have had the same cache directory pointed to for ten year in configure:-
define('DIR_FS_SQL_CACHE', '/home/******/public_html/cache');
Is there a way to stop this check? I am sure the above is valid, I haven't changed it. I created more cache folders in admin as swguy put, and all permissions are 777. Hope somebody may be able to help please. thanks in advance.
Re: Fresh install admin access fails with too many redirects
I tried the replacement file contained here in this thread to no avail :-(
Re: Fresh install admin access fails with too many redirects
So where is it at now?
- what ZC version are you using?
- which init_cache_key_check.php file are you now using?
- are you actually getting just "blank page"? or are you really getting the "too many redirects"?
- Is your webserver running Linux/Ubuntu/CentOS/Windows/... what? If you don't know the answer to that, normally you could get it via your Admin, but since that's where your problem is, you could ask your hosting company to tell you what operating-system your server is using. They can answer the PHP questions too, if you don't know the answers:
- what's your PHP version? Is it running "PHP as CGI"? or "suPHP"? or simply as an Apache module?