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

James Miller gajs-f0el at dea.spamcon.org
Sun Apr 19 23:20:35 UTC 2015


On Sat, 18 Apr 2015, George Nassas wrote:

>> On Apr 18, 2015, at 3:47 PM, James Miller <gajs-f0el at dea.spamcon.org> wrote:
>> 
>> * 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?
>
> Yes. You can also add a comment after the semicolon (comments start with 
> //) with some unique text to know what you changed in case you have to 
> back it out.

I tried this modification first. Restarting nginx via "/etc/init.d/nginx 
restart," then issuing "curl http://localhost" resulted in the same output 
I was previously seeing--a bunch of html code and, at the end

<b>Fatal error</b>:  Call to a member function query_col() on a non-object 
in <b>/var/www/localhost/htdocs/mythweb/includes/utils.php</b> on line 
<b>59</b><br />

>> * @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();
>> 
>
> Yes. Or, comment out the existing global $db; and add a new line with 
> the assignment and a unique comment like the one above.

So next I did this modification, leaving the previous one in place. Again 
I restarted nginx and even php-fpm this time, but on running "curl 
http://localost" I get the same results as above. Trying to access that 
address using a graphical browser on localhost just gives me a blank page.

> If this little theory is correct you'll probably get the same "db has no 
> member named" error but in a different place. At that point we'd go 
> through and replace all the global db declarations with db assignments.

Seems to me the theory is not correct, true? Does this mean it's time to 
throw in the towel on trying to get MythWeb working through this 
nginx/php-fpm combination? If you're out of ideas on how to resolve the 
matter, then it seems I'll have to abandon the effort: I was out of ideas 
a long time ago--calling my understanding of how this is all supposed to 
work together "rudimentary" would be an overstatement.

>> 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.
>
> I should have looked at the docs on this 
> (http://nginx.org/en/docs/http/server_names.html) but it turns out 
> giving an invalid host name like _ ends up being a match-all. I use 
> virtual hosts so I never needed to do this but with a single-site setup 
> you don't care how clients get to your myth box, you just want them to 
> see mythweb. Of course, bounce nginx or, I think, do "nginx -s reload" 
> before browsing remotely.

I'm not following very well what you're explaining here. I looked at that 
page, which is a bit over my head, and I did try entering an underslash in 
place of "localhost," after server_name in nginx.conf. I think "bounce 
nginx" on my system equates to "/etc/init.d/nginx restart," but after 
having put the underslash in nginx.conf in place of "localhost" and 
running that command, I still can't access the machine from another on my 
LAN. When I enter its IP in the browser's address bar and hit "enter," the 
browser just sits loading forever but never showing anything.

In case the time has come to abandon my attempts at serving MythWeb via 
nginx, I'll need next to start looking into the standard solution of just 
using Apache--as was advised toward the beginning of this thread. Let me 
just tack onto the end of this response, then, a question for fellow 
Gentoo users who might be serving MythWeb via Apache: what flags do I need 
to set when compiling Apache for MythWeb? I would guess, at the least, 
mysql and mysqli, but are there others? Do I need to compile in support 
for php as well?

I've got to have MythWeb running on this machine for it to serve my 
purposes, so I view my task as a matter of finding a web server that will 
work here, not one of doing without MythWeb.


More information about the mythtv-users mailing list