[mythtv-users] alt lightweight web servers for MythTV?

James Miller gajs-f0el at dea.spamcon.org
Sat Apr 18 19:47:42 UTC 2015


On Sat, 18 Apr 2015, George Nassas wrote:

> so I wonder if somehow that is coming into play here (and I was 
> wondering if something in php.ini controlled that). I’m not sure why you 
> would be affected and no one else but lets follow this where it goes. 
> Turns out php has a concept of “superglobals” which don’t have scoping 
> quirks so I’d like to try changing includes/database.php to add a line 
> at the end of the file:
>
> 	$GLOBALS[‘db’] = $db;
>
> and give mythweb a try, if it still fails change includes/util.php below 
> the "function setting” line is a "global $db" line, change that to $db = 
> $GLOBALS[‘db’];

Thanks for your continued input, George. Just a couple of points of 
clarification on this. In the referenced database.php file on this system, 
about halfway into the file, there is the stanza:

  * All database connections should now go through this object.
  *
  * @global  Database    $GLOBALS['db']
  * @name    $db
/**/
     global $db;

Your suggestion, then, is to just leave that as-is and add $GLOBALS[‘db’] 
= $db; to the end of that file, right? And if that doesn't resolve 
anything, then just leave that revision in place and edit utils.php 
(utils, not util, on this system) as indicated, correct?

In the utils.php file, the first part of the first stanza looks like this:

  * @return string The value (settings.data) associated with $field and 
$hostname.
/**/
     function setting($field, $hostname=null, $new_value = "old\0old", 
$clearSettingsCache = true) {
         global $db;
         static $cache = array();

So, I'll be replacing that "global $db;" line with $db = $GLOBALS[‘db’]; 
--including the semicolon, correct?

> If that fails then I’m completely stumped.

Let's hope it doesn't come to that.

> If you have a “listen 80;” line you might need to extend the 
> “server_name” line to include all possible names for the machine 
> separated by spaces. I don’t know if ip numbers are welcome there but 
> why not give it a try.

I have "listen 80;" in /etc/nginx/nginx.conf, yes. Immediately afterward 
is the line "server_name localhost." I've added to that latter line both 
the hostname of the myth machine on my LAN and its LAN IP (don't know if 
there should be commas between, but I've just put spaces). After 
restarting nginx, still no remote access.


More information about the mythtv-users mailing list