Opened 15 years ago
Closed 11 years ago
#9405 closed Patch - Bug Fix (Won't Fix)
MythWeb doesn't work with PHP in CGI mode
| Reported by: | 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)
Change History (5)
by , 15 years ago
| Attachment: | phpinfo.htm added |
|---|
comment:1 by , 15 years ago
| Resolution: | → Won't Fix |
|---|---|
| Status: | new → closed |
comment:3 by , 15 years ago
| Resolution: | Won't Fix |
|---|---|
| Status: | closed → new |
comment:4 by , 11 years ago
| Resolution: | → Won't Fix |
|---|---|
| Status: | new → closed |
Given Mythweb is EOL, I'm closing new features. This should be done via the backend webserver now.

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.