octobercms / install

Installation wizard for October CMS
122 stars 91 forks source link

Add mod_rewrite check for CGI environments #94

Closed Knappster closed 6 years ago

Knappster commented 6 years ago

'HTTP_MOD_REWRITE' key is renamed to 'REDIRECT_HTTP_MOD_REWRITE' in CGI/FastCGI environments.

LukeTowers commented 6 years ago

@Knappster isn't that var just set by the .htaccess: https://github.com/octobercms/install/blob/master/.htaccess#L3. Why would it change in CGI/FastCGI environments?

Knappster commented 6 years ago

When using PHP as a CGI binary instead of a module, environment variables set by Apache are prefixed with 'REDIRECT_'.

I first ran into this issue using MAMP when configured to run different versions of PHP for each host. The check for mod_rewrite would always fail.

The same issue occurred on a shared hosting server we have, also configured to run different versions of PHP for each host.