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

George Nassas gnassas at mac.com
Wed Apr 15 04:32:11 UTC 2015


On Apr 13, 2015, at 11:58 AM, James Miller <gajs-f0el at dea.spamcon.org> wrote:

> I want to ask here for some clarification regarding php-fpm (as it is mentioned in the wiki--see https://www.mythtv.org/wiki/MythWeb_on_Nginx). I've been under the impression that I should be using this in conjunction with nginx, though I'm now beginning to wonder, after a recent rereading of the wiki article, whether it might not be optional. The wiki says "Nginx doesn't have PHP support built in, and it must be configured for it. The old way was to use fast-cgi. If you are using nginx, you are trying to get performance and scalability. Forget FastCGI and install php-fpm." So is php-fpm a requirement or an option, when one is trying to serve MythWeb using nginx?

php-fpm is a requirement. nginx mostly shuffles bytes around, usually bytes from a file through a network connection to your browser but for php source code it sends that file to php-fpm and passes whatever output is generated down the network to your browser. nginx also passes back error messages which brings us to…

> <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 />
> 
> Am I seeing an issue here such is addressed in this thread http://lists.mythtv.org/pipermail/mythtv-users/2013-December/357920.html ?

The good news is you have nginx and php-fpm configured to talk to each other, they are, and php-fpm is trying to execute mythweb code. The line 59 mentioned in the error looks like this:

                $cache[$h][$field] = $db->query_col('SELECT data
                                                       FROM settings
                                                      WHERE value=? AND hostname IS NULL',
                                                    $field);

which means the $db variable is invalid so I bet you’re right that the issue is no connection to mysql. You can get a better idea of why you might not be connecting by creating a file “test.php” in the mythweb directory with the contents:

<?php
mysql_connect('localhost', 'mythtv', 'mythtv') or die('Could not connect: ' . mysql_error());
mysql_select_db('mythconverg') or die('Could not select database');
?>

and then doing a curl http://localhost/test.php <http://localhost/test.php>. No output means you’re connecting to the database OK so look elsewhere but you should get an error message. If you’ve given mythweb other login credentials (like an ip number for the host name) then use those values instead. 

- George

P.S. Last time you mentioned how you couldn’t browse to mythweb from other machines, did you tweak the listen line and how did it go?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20150415/93fc0755/attachment.html>


More information about the mythtv-users mailing list