Opened 9 years ago

Closed 5 years ago

#9405 closed Patch - Bug Fix (Won't Fix)

MythWeb doesn't work with PHP in CGI mode

Reported by: wondra <wondra@…> Owned by: Rob Smith
Priority: minor Milestone: unknown
Component: Plugin - MythWeb Version: 0.23-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

In my Debian testing/squeeze, I have "Apache/2.2.16" and "PHP 5.3.3-6 with Suhosin-Patch (cgi-fcgi)". I have installed "mythtv-0.23.0+fixes24158-0ubuntu2" so that it is compatible with my already running Mythbuntu 10.04.

The result was that MythWeb was all white, all links in the menu had cgi-bin in them and it said "An unknown module was specified". In the apache error log was: [error] [client 192.168.0.1] script not found or unable to stat: /usr/lib/cgi-bin/js, referer: http://192.168.0.1/mythweb/ [error] [client 192.168.0.1] script not found or unable to stat: /usr/lib/cgi-bin/skins, referer: http://192.168.0.1/mythweb/

The quick and dirty solution is, in mytweb/includes/defines.php:

Figure out the root path for this mythweb installation. We need this in order to cleanly reference things like the /js directory from subpaths. if (isset($_SERVERORIG_SCRIPT_NAME?) && !isset($_SERVERFCGI_ROLE?)) define('root', str_replace('', '/', dirname($_SERVERORIG_SCRIPT_NAME?).'/')); else

define('root', str_replace('', '/', dirname($_SERVERSCRIPT_NAME?).'/'));

AND

if/* (isset($_SERVERORIG_PATH_INFO?) && !isset($_SERVERFCGI_ROLE?))

$Path = $_SERVERORIG_PATH_INFO?;

elseif*/ (isset($_SERVERPATH_INFO?))

$Path = $_SERVERPATH_INFO?;

elseif (isset($_ENVPATH_INFO?))

$Path = $_ENVPATH_INFO?;

elseif (isset($_GETPATH_INFO?))

$Path = $_GETPATH_INFO?;

In short, my cgi-mode PHP doesn't set $_SERVERFCGI_ROLE?, by which you detect CGI. Suggested solution - look the string "cgi-bin" or "php5" in $_SERVERORIG_PATH_INFO? instead of $_SERVERFCGI_ROLE?.

phpinfo() output attached.

Attachments (1)

phpinfo.htm (64.2 KB) - added by wondra <wondra@…> 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by wondra <wondra@…>

Attachment: phpinfo.htm added

comment:1 Changed 9 years ago by Rob Smith

Resolution: Won't Fix
Status: newclosed

We don't support this install type and your work around breaks for everyone else. If you have a way for us to detect this install type cleanly without relying on a path (cgi-bin). Please let me know.

comment:2 Changed 9 years ago by wondra <wondra@…>

What about php_sapi_name()? Returns 'cgi-fcgi' here.

comment:3 Changed 9 years ago by Rob Smith

Resolution: Won't Fix
Status: closednew

comment:4 Changed 5 years ago by Rob Smith

Resolution: Won't Fix
Status: newclosed

Given Mythweb is EOL, I'm closing new features. This should be done via the backend webserver now.

Note: See TracTickets for help on using tickets.