[mythtv-commits] Ticket #9405: MythWeb doesn't work with PHP in CGI mode
MythTV
noreply at mythtv.org
Fri Dec 24 10:46:05 UTC 2010
#9405: MythWeb doesn't work with PHP in CGI mode
------------------------------------------+------------------------
Reporter: wondra <wondra@…> | Owner: kormoc
Type: Patch - Bug Fix | Status: new
Priority: minor | Milestone: unknown
Component: Plugin - MythWeb | Version: 0.23-fixes
Severity: medium | Keywords:
Ticket locked: 0 |
------------------------------------------+------------------------
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($_SERVER['ORIG_SCRIPT_NAME']) &&
!isset($_SERVER['FCGI_ROLE']))
// define('root', str_replace('//', '/',
dirname($_SERVER['ORIG_SCRIPT_NAME']).'/'));
// else
define('root', str_replace('//', '/',
dirname($_SERVER['SCRIPT_NAME']).'/'));
AND
if/* (isset($_SERVER['ORIG_PATH_INFO']) &&
!isset($_SERVER['FCGI_ROLE']))
$Path = $_SERVER['ORIG_PATH_INFO'];
elseif*/ (isset($_SERVER['PATH_INFO']))
$Path = $_SERVER['PATH_INFO'];
elseif (isset($_ENV['PATH_INFO']))
$Path = $_ENV['PATH_INFO'];
elseif (isset($_GET['PATH_INFO']))
$Path = $_GET['PATH_INFO'];
In short, my cgi-mode PHP doesn't set $_SERVER['FCGI_ROLE'], by which you
detect CGI.
Suggested solution - look the string "cgi-bin" or "php5" in
$_SERVER['ORIG_PATH_INFO'] instead of $_SERVER['FCGI_ROLE'].
phpinfo() output attached.
--
Ticket URL: <http://code.mythtv.org/trac/ticket/9405>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center
More information about the mythtv-commits
mailing list