[mythtv-users] alt lightweight web servers for MythTV?
George Nassas
gnassas at mac.com
Sat Apr 18 18:35:08 UTC 2015
On Apr 17, 2015, at 12:55 PM, James Miller <gajs-f0el at dea.spamcon.org> wrote:
> 12 recordings
>
> Seems like it's communicating with the database, no? I do not currently have 12 recordings on this machine, which I'm still testing. I've probably recorded 12 programs thus far, and may have 12 upcoming programs slated for recording. But isn't the fact that curl'ing that page returns some data, significant?
Yup, everything looks fine from the php/mysql perspective. The 12 includes ones that are marked for deletion, when you delete they get moved to a “Deleted” recording group and, depending on a setting, expire away after N many days. That may not have happened. You can get more info by going into mysql and doing “select starttime, title, subtitle, recgroup from recorded”
>> I also added some output for a successful run. I tried screwing up the credentials on my running mythweb instance but it failed in the “right” way - I got all sorts of output telling me my db config was screwed up etc. so the fact that yours is running through that code without complaint and then failing later on makes me wonder. It could be that something subtle has changed in php or you don’t have some php.ini setting the way mythweb wants and the database handle isn’t being saved as intended. I’ll look through the code for some place to put helpful logging and post back later.
>
> The one thing that jumped out at me when looking over the output of info.php was lines like "--with-mysql-sock=/var/run/mysqld/mysqld.sock" and similar. Does that mean mean this version of php was compiled to communicate with mysql using a particular socket? I'm not knowledgeable enough to know whether that has any significance to my issue, but it was something I made note of and wondered about. I'll look over php.ini again to see whether, despite my lack of conversance in this matter, I note anything else there.
I stepped back a bit and looked at what the code is doing and I don’t think it’s a config issue. We’ve demonstrated you can connect to the database and pull out information and I tested what my mythweb does when there’s a db problem and it’s complain loudly. The fact that yours isn’t saying anything means it’s connecting to the database successfully. After the connection is made in includes/database.php it saves the handle in a global variable $db. Later on, in includes/utils.php, it references that global for queries but in your case the value isn’t there. I looked into it and it seems php globals are problematic:
http://stackoverflow.com/questions/3193774/php-global-variable-is-undefined-inside-a-function-even-if-global-keyword-is-use <http://stackoverflow.com/questions/3193774/php-global-variable-is-undefined-inside-a-function-even-if-global-keyword-is-use>
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’];
If that fails then I’m completely stumped.
> No remote access so far. When I enter the machine's IP followed by /mythweb/test.php or simply /test.php, into the address field of a browser running on another computer located on my LAN, the browser just sits attempting to load the page but never succeeding. So, something's not configured correctly for remote access.
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.
- George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20150418/cd50a250/attachment.html>
More information about the mythtv-users
mailing list