ERR_TOO_MANY_REDIRECTS logging in to ocadmin

Open to all! Ask other shopowners for help.
yeno
Member
Posts: 5
Joined: Sat Dec 12, 2020 1:48 pm
Phoenix Version:

Re: ERR_TOO_MANY_REDIRECTS logging in to ocadmin

Post by yeno »

Theory

Ok, Gary, I understand. But shared hosting settings cannot be changed. And for a user it doesn't seem to be like a hosting error, but an application. Because all the other CMS are working there.

My opinion is that it's not good idea to force a user to change his hosting where he can run another CMS, store data, etc. An accessibility is good for user. What is good for one user is good for the community. So, let's improve it. Agree?

BTW there are over 100.000 shared hostings with the same settings where I'm testing CE Phoenix. The provider offer pre-installed systems like WordPress, Joomla, etc. There is only one pre-installed e-commerce system, PrestaShop. I think there might be Phoenix too. But the first condition is a compatibility with hosting(s).

Solution suggestion

There should be new const INSTALLED_TO_SUBFOLDER = (true|false)
in admin/includes/configure.php
  • There can be opt-in checkbox INSTALLED_IN_SUBFOLDER in the installation, e.g. "Installation to subdirectory - if you install application to other subdirectory then root www/, e.g. www/mysubdirectory/".
  • Or it might be automatically detected from const DIR_FS_CATALOG.
    In my case DIR_FS_CATALOG = '/data/web/virtuals/USER-ID/virtual/www/subdom/eshop/'

The following code was NOT TESTED, it's just a concept.

admin/includes/configure.php (line 15)

Code: Select all

DIR_FS_CATALOG  = '/data/web/virtuals/USER-ID/virtual/www/subdom/eshop/'

if(stristr(DIR_FS_CATALOG, '/www/') {
    $subdir_path = explode(DIR_FS_CATALOG, , '/www/');
    $subdir_path = $subdir_path[1];
    if(subdir_path !=="") {
        const INSTALLED_TO_SUBFOLDER = true;
    } else {
        const INSTALLED_TO_SUBFOLDER = false;
    }
}
I know there should be not only condition but an exeption, whether the root folder is named "www". I think the probability is close to zero, "www" should be default, but…

admin/includes/application_top.php (line 42)

Code: Select all


  // set php_self in the local scope
  if(INSTALLED_TO_SUBFOLDER == true;) {  
      $PHP_SELF = basename($_SERVER['SCRIPT_NAME']);
  } else {
      $req = parse_url($_SERVER['SCRIPT_NAME']);
      $PHP_SELF = substr($req['path'], strlen(DIR_WS_ADMIN)); 
  }
What do you think about?


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: ERR_TOO_MANY_REDIRECTS logging in to ocadmin

Post by burt »

> What do you think about?

Seems like a lot of work to deal with a situation that rarely arises. I don't want to go tail-chasing to suit hosts who set up their server in a non-standard way.
I am not here to build for you.
I am here to build with you. Let's help each other.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply