In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Type Reproducibility Date Submitted Last Update
0001427 [In-Portal CMS] Install / Upgrages bug report always 2012-11-05 10:28 2012-11-07 10:48
Reporter alex View Status public Project Name In-Portal CMS
Assigned To alex Developer
Priority normal Resolution fixed Fixed in Version 5.2.1-B1
Status resolved Product Version 5.2.0 Target Version 5.2.1
Time EstimateNo estimate
Summary 0001427: Mod-rewrite detection doesn't work when PHP is installed as CGI
Description When PHP is installed as CGI and not as "mod_php" into Apache, then system requirements step tells, that mod rewrite is not available.
But in fact mod rewrite works absolutely normally.

I propose to improve detection as advised by http://christian.roy.name/blog/detecting-modrewrite-using-php article by setting custom environment variable in .htaccess file, like this:

<IfModule mod_rewrite.c>
    // Tell PHP that the mod_rewrite module is ENABLED.
    SetEnv HTTP_MOD_REWRITE On
</IfModule>

and checking it later inside PHP:

if ( function_exists('apache_get_modules') ) {
    $modules = apache_get_modules();
    $mod_rewrite = in_array('mod_rewrite', $modules);
} else {
    $mod_rewrite = getenv('HTTP_MOD_REWRITE')=='On' ? true : false;
}


I also recommend wrapping whole rewrite-related code inside that IfModule statement since if mod-rewrite is really unavailable, then any directive from it (e.g. RewriteEngine) could cause "500 Internal Server Error" for whole website.
Additional Information
Tags No tags attached.
Reference https://groups.google.com/d/topic/in-portal-bugs/Xw33wdGc3nI/discussion
Change Log Message Fixes mod-rewrite module detecting during installation/upgrade
Estimate Points 1
Attached Files patch file icon mod_rewrite_detection_1427.patch [^] (5,045 bytes) 2012-11-07 09:19 [Show Content]
patch file icon mod_rewrite_detection_1427_v2.patch [^] (4,999 bytes) 2012-11-07 10:47 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
User avatar (0005266)
erik (manager)
2012-11-07 06:41

Done. Patch attached. Needs testing
User avatar (0005267)
alex (manager)
2012-11-07 07:26

1. Mod-rewrite Apache module related directives in .htaccess file were not wrapped with IF statement as advised.

2. Code isn't properly formatted (use automatic formatting of IDE to prevent this error in future).
User avatar (0005274)
erik (manager)
2012-11-07 09:20

1. Changed to wrap directives

2. Changed code formatting

Patch replaced with new version. Needs testing
User avatar (0005283)
alex (manager)
2012-11-07 10:48

Patch "mod_rewrite_detection_1427_v2.patch" has simplified code version and few empty lines removed.
User avatar (0005284)
alex (manager)
2012-11-07 10:48

OK
User avatar (0005285)
alex (manager)
2012-11-07 10:48

Fix committed to 5.2.x branch. Commit Message:

Fixes 0001427: Mod-rewrite detection doesn't work when PHP is installed as CGI
Commit on behalf of Erik

- Related Changesets
In-Portal CMS: 5.2.x r15620
Timestamp: 2012-11-07 10:48:48
Author: alex
Details ] Diff ]
Fixes 0001427: Mod-rewrite detection doesn't work when PHP is installed as CGI
Commit on behalf of Erik
mod - /in-portal/branches/5.2.x/.htaccess Diff ] File ]
mod - /in-portal/branches/5.2.x/core/install/prerequisites.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2012-11-07 10:48 alex Note Added: 0005285
2012-11-07 10:48 alex Status reviewed and tested => resolved
2012-11-07 10:48 alex Fixed in Version => 5.2.1-B1
2012-11-07 10:48 alex Resolution open => fixed
2012-11-07 10:48 alex Assigned To !COMMUNITY => alex
2012-11-07 10:48 alex Changeset attached 5.2.x r15620
2012-11-07 10:48 alex Note Added: 0005284
2012-11-07 10:48 alex Assigned To alex => !COMMUNITY
2012-11-07 10:48 alex Status needs testing => reviewed and tested
2012-11-07 10:48 alex Note Added: 0005283
2012-11-07 10:47 alex File Added: mod_rewrite_detection_1427_v2.patch
2012-11-07 09:21 erik Status needs work => needs testing
2012-11-07 09:21 erik Status needs testing => needs work
2012-11-07 09:21 erik Assigned To erik => alex
2012-11-07 09:20 erik Note Added: 0005274
2012-11-07 09:20 erik Status needs work => needs testing
2012-11-07 09:19 erik File Added: mod_rewrite_detection_1427.patch
2012-11-07 09:19 erik File Deleted: mod_rewrite_detection_1427.patch
2012-11-07 07:26 alex Note Added: 0005267
2012-11-07 07:26 alex Assigned To => erik
2012-11-07 07:26 alex Status needs testing => needs work
2012-11-07 06:41 erik Note Added: 0005266
2012-11-07 06:41 erik Developer => erik
2012-11-07 06:41 erik Status active => needs testing
2012-11-07 06:41 erik File Added: mod_rewrite_detection_1427.patch
2012-11-05 10:28 alex New Issue
2012-11-05 10:28 alex Reference => https://groups.google.com/d/topic/in-portal-bugs/Xw33wdGc3nI/discussion
2012-11-05 10:28 alex Change Log Message => Fixes mod-rewrite module detecting during installation/upgrade
2012-11-05 10:28 alex Estimate Points => 1



Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker