12.10 MythWEb PHP Fatal Error
I'm posting this in the event it can be useful to someone else:
After upgrading to the latest 12.10 release, MythWeb started showing a blank page. Not finding anything on the ubuntuforums I poked around and found this:
http://code.mythtv.org/trac/ticket/10504
If you have the following error appearing in your /var/log/apache2/error.log:
Code:
[Sun Oct 21 10:08:24 2012] [error] [client 192.168.1.26] PHP Warning: Unknown: function '0' not found or invalid function name in Unknown on line 0
[Sun Oct 21 10:08:25 2012] [error] [client 192.168.1.26] PHP Fatal error: Call-time pass-by-reference has been removed in /usr/share/mythtv/bindings/php/MythBase.php on line 50
Applying the patches provided in that but thread resolved the PHP Fatal error so that MythWeb now works again.
Re: 12.10 MythWEb PHP Fatal Error
I apologize for sounding kinda NOOB on this. How exactly did you apply the patches? I'm running Myth .25 and I'm not exactly sure how to apply these patches. I'm guessing that its sudo patch original and then new file? I also can't find the MythBase either. Thanks.
Re: 12.10 MythWEb PHP Fatal Error
There's an automated way of applying them, but I just manually edited/applied them.
If you look at the top of the patch files, it'll show you part of the path to the file. The easiest way is to use the 'locate' command if it's been installed:
locate MythBase.php
/usr/share/mythtv/bindings/php/MythBase.php
Then I just used my favorite editor to open/edit the file. The patch includes the approximate line number where you need to edit:
*** 51,57 ****
That gets you to the location within the file. Then just look at the lines beginning with the '!' character - the first one shows you the original, the 2nd one shows you what it needs to be changed to:
original:
! Cache::setObject($this->cacheKey, &$this, $this->cacheLifetime);
Change it to:
! Cache::setObject($this->cacheKey, $this, $this->cacheLifetime);
If the lines are new (added) in the patch, they're preceeded by a '+' sign.
For safety/sanity reasons, save a copy of the original file first. That way if you accidentally make a mistake you can get the original file back and start over.
Re: 12.10 MythWEb PHP Fatal Error
to automatically apply then just use the patch command
Download the patch files from http://code.mythtv.org/trac/ticket/10504 to a directory on your myth backend server
Using the --backup with the patch command will rename the original file as .php.orig so you can go back if the patch breaks something
Code:
sudo patch --backup /usr/share/mythtv/bindings/php/MythBase.php MythBase.php.patch
sudo patch --backup /usr/share/mythtv/mythweb/includes/sorting.php sorting.php.patch
sudo patch --backup /usr/share/mythtv/mythweb/modules/tv/schedules.php tv-schedules.php.patch
sudo patch --backup /usr/share/mythtv/mythweb/modules/tv/tmpl/default/schedules.php schedules.php.patch
Re: 12.10 MythWEb PHP Fatal Error
Does anyone know when these patches might be incorporated into a build available within Quantal (either -proposed or -backports, probably)? As it stands, I can't update the mythtv packages without breaking mythweb, and that seems... suboptimal.
Re: 12.10 MythWEb PHP Fatal Error
Well, the MythWeb packages were just updated and the patches were not included. So I had to reapply all of the patches again.
Re: 12.10 MythWEb PHP Fatal Error
Quote:
Originally Posted by
drumz
Well, the MythWeb packages were just updated and the patches were not included. So I had to reapply all of the patches again.
I noticed that, too -- not the first time it's happened. I gave in and wrote a shell script that applies the patches all in one shot, at least. For now, I guess that'll have to do. Once I have time, I'm gonna look into these packages on Launchpad, see if they're incorporating the patches soon, and if not, suggest they do.
Re: 12.10 MythWEb PHP Fatal Error
Being irritated enough I was motivated to look:
HTML Code:
https://bugs.launchpad.net/ubuntu/+source/mythtv/+bug/1048121
Last post was in October, there doesn't seem to be a lot of activity on this. I'm going to pipe up on it that it's affecting me and the patches work to hopefully draw some attention to it.
Re: 12.10 MythWEb PHP Fatal Error
Quote:
Originally Posted by
drumz
Being irritated enough I was motivated to look:
HTML Code:
https://bugs.launchpad.net/ubuntu/+source/mythtv/+bug/1048121
Last post was in October, there doesn't seem to be a lot of activity on this. I'm going to pipe up on it that it's affecting me and the patches work to hopefully draw some attention to it.
I also commented on the Launchpad ticket, in the hopes some activity might draw some attention to the issue.
It occurs to me that, in the meantime, if you lock the version of mythtv-common, that should stop all updates to the mythtv packages from processing. It's not ideal, of course, since they're ostensibly pushing bugfixes in those updates, but it's one way to stop the breakage until a solution is implemented.
Re: 12.10 MythWEb PHP Fatal Error
For those not following along on the above post bug link:
One of the devs responded and basically it's unlikely it'll be fixed in 0.25 (what's natively the 'current' version available for 12.10) unless upstream (i.e. MythTV people) back port it to 0.25.
The suggested fix is to upgrade to 0.26 (which I checked and is available for 12.10 via a ppa here http://www.ubuntuupdates.org/ppa/mythtv_0.26).
I did politely respond back that (IMHO) expecting people to go out of the normal realm to upgrade to 0.26 for a known (and literally show stopping) bug just to get the fix is not the most user friendly. And I did thank him for responding since we weren't left hanging and did get some closure on it...