OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Problems with PHP 5.3 (Class 'HookRegistry' not found)

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby biomat » Fri Nov 06, 2009 4:02 am

Well, this is getting really old and the
HookRegistry
not found error on line 175 is really embarrassing. The fix of making the IF statement false helps but it also is an embarrassment. I wrote the following announcement in my journal with this regard:

MCFNS System: Update on the PHP upgrade ERROR

We have implemented a temporary fix for the logging in and out of the system. The HookRegistry not found error is not showing anymore but the screen display is frequently going into 404 blank page errors, which needs to be screen-refreshed for displaying properly. In addition, after logging in or out the screen cannot be just refreshed but needs to be backed up to previous screen and then refreshed, or even worse: unsuccessfully refreshed, and then backed out to previous display, and then refreshed. We know how idiotic this all sounds and do not want to encourage anyone to do anything other than patiently wait for the real solution, and correspond in the meantime by email with the journal editor at editor@mcfns.com


Without the fix nobody can log on. With the fix you have to keep one hand of the screen refresh key and one on the mouse because you have to refresh the screen just about every time you click something or press return. It's a nightmare. Can anyone help PLEASE?

Please note that fixing of the bug 4775 doesn't help at all with this problem. We have even tried new installations of different versions of OJS and it seems quite simply that none of the OJS versions work with PHP 5.2.11 (note I originally stated that it was 5.3 but after checking the version I found that that was not correct) because of the problem with referencing the include files (or at least referencing the HookRegistry). We have even asked the host administrator to role back the PHP installation to an older version, but he refused stating that the upgrade is security related and that Drupal works fine with it, so that's the OJS problem not the PHP upgrade problem. Can you find a fix for it please?

BTW, is there anyone out there who has an OJS installation running well in PHP 5.2.11 environment?
biomat
 
Posts: 23
Joined: Wed Jul 23, 2008 11:07 am

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby jmacgreg » Mon Nov 09, 2009 4:33 pm

Hi Biomat,

Can you tell us which version of OJS you are currently using? Alternatively, have you attempted simply suppressing the error as per Matt's instructions in this thread instead of patching your system?

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby asmecher » Wed Nov 11, 2009 5:10 am

Hi biomat,

The team tests and develops with both PHP 5.2.11 and PHP 5.3 without any issues, so there must be something else happening here.

It's difficult for us to debug without being able to duplicate the problem locally, but could you try inserting the following line into DAO.inc.php:
Code: Select all
import('plugin.HookRegistry');
...after the lines...
Code: Select all
import('db.DBConnection');
import('db.DAOResultFactory');
import('core.DataObject');
...near the top of the file?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby biomat » Wed Nov 11, 2009 11:55 am

The same error (just with different file addresses and reference code line numbers) is showing for the versions 2.2.2, 2.2.3, and 2.3.

The PHP version is 5.2.11. I'm currently actually struggling with the OJS version 2.2.2 because that is where all the data are for the journal (mcfns.com). The version 2.2.2 allows to log on easier then 2.3 when after inserting the "&& false" part. We tested all the three versions on this server (on Hot Drupal server) and they all gave the same problem.

We didn't try suppressing the error because the problem for us is that you cannot log on rather than that there is an error displayed.

We have tried to insert the "import('plugin.HookRegistry');" and the "import('plugins.HookRegistry');" and it didn't work. In the 2.2.2 version there are none of the other import statements so we put this import statement at the very beginning of the file. This action only changed the error line from 175 to 176. In the newer version we tried to insert the import statement after the other three imports and before them. It's all the same (Fatal error: Class 'HookRegistry' not found in /home/rlogisco/public_html/ocs/hd.somens.org/lib/pkp/classes/db/DAO.inc.php on line 191) and you cannot log on.

Trying to add the "&& false" in the 2.3 version results in: "Fatal error: Class 'Core' not found in /home/rlogisco/public_html/ocs/hd.somens.org/lib/pkp/classes/db/DAO.inc.php on line 196".

Thank you for trying to address this problem.
biomat
 
Posts: 23
Joined: Wed Jul 23, 2008 11:07 am

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby ambs » Wed Nov 11, 2009 12:12 pm

I am getting the same Core not found messages. At the moment linguamatica.com is running with that &&false tweak, but sometimes does not let users login. Some other times, it does. It is quite unstable :(
ambs
 
Posts: 31
Joined: Tue Sep 22, 2009 1:49 pm

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby asmecher » Wed Nov 11, 2009 12:43 pm

Hi all,

Unfortunately, I'm still unable to reproduce this locally. Would one of you be willing to provide me with temporary credentials to access a server demonstrating this problem? If so, please PM them to me.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby asmecher » Wed Nov 11, 2009 4:07 pm

Hi all,

The problem (at least in ambs' case) is the upgrade process that was followed; it left some extra files in place that were causing trouble.

If you simply extract the new OJS 2.3 archive over top of an older installation, the following happens: since some files were moved to a different directory between OJS 2.2.x and OJS 2.3 -- for example, classes/db/DAO.inc.php became lib/pkp/classes/db/DAO.inc.php -- then copying the new version's contents into the directory an old version was installed into will mean both old and new versions of some files will exist in different directories. In some cases the wrong one will get imported, leading to glitches.

To correct this, I suggest comparing a list of files in your install (e.g. using ls -R) against a list of files in the stock OJS 2.3 installation (e.g. using tar tzf /path/to/ojs-2.3.0.tar.gz). Remove any extra .php classes, unless you've put them there for some other reason (e.g. modifications to the system), excepting of course the OJS configuration file. (Back everything up before you remove files, just in case.)

If you follow the upgrade directions in docs/UPGRADE, you will avoid this situation.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby biomat » Wed Nov 11, 2009 6:27 pm

ambs wrote:I am getting the same Core not found messages. At the moment linguamatica.com is running with that &&false tweak, but sometimes does not let users login. Some other times, it does. It is quite unstable :(


Ditto! I get the same behavior in OJS 2.3 (hd.somens.org). Sometimes even I seemingly cannot log on but a couple of minutes later after refreshing the screen again it appears that I'm all of a sadden logged on... I couldn't figure out any patterns.

OJS 2.2.2 however is quite predictable - just have to press F5 every click or key.

The bug in OJS 2.2.2 surfaced up w/o any OJS installations or upgrades (mcfns.com), but merely after upgrading the PHP installation. The OJS 2.3 (hd.somens.org) bug surfaced after a new clean installation performed specifically to see if the OJS upgrade would fix the problem.

Thank you for your efforts. I'll get back to you with the server access information - just need to get the permission of the owner first.
biomat
 
Posts: 23
Joined: Wed Jul 23, 2008 11:07 am

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby mary » Wed Nov 11, 2009 9:35 pm

I have the 'HookRegistry' not found (and, if the && false is added, the 'Core' not found problem) on a fresh install of 2.3 using PHP 5.2.10 (Ubuntu 5.10). I definitely only have one copy of files with these names:

$ find -name HookRegistry.inc.php
./lib/pkp/classes/plugins/HookRegistry.inc.php
$ find -name DAO.inc.php
./lib/pkp/classes/db/DAO.inc.php
$ find -name Core.inc.php
./lib/pkp/classes/core/Core.inc.php

I can arrange access if need be.
mary
 
Posts: 8
Joined: Fri Oct 26, 2007 12:17 am

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby asmecher » Wed Nov 11, 2009 10:43 pm

Hi Mary,

Yes, please PM me with details.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby asmecher » Wed Nov 11, 2009 11:15 pm

Hi all,

A bit of searching has turned up some further discussion of this as a PHP and/or APC bug; see http://pecl.php.net/bugs/bug.php?id=16721 and http://bugs.php.net/bug.php?id=48787. In particular, the latter link (PHP bug #48787) looks identical to this issue. If you're using APC, please try disabling it and report your results back here. (Before reporting back, make sure it's actually disabled by checking your phpinfo() output.)

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby asmecher » Fri Nov 13, 2009 12:23 pm

Hi all,

I have confirmation from ambs (thanks) that this is APC-related; disabling APC resolved the problem.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby dxmwml » Mon Dec 07, 2009 9:20 am

Would using an apc.filters to exclude the work to stop this problem?

Here is my error:

[Mon Dec 07 09:27:59 2009] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error: Class 'HookRegistry' not found in /www/docs/wally/oajournals/lib/pkp/classes/db/DAO.inc.php on line 190, referer: http://library.rit.edu/oajournals/
dxmwml
 
Posts: 23
Joined: Mon Nov 07, 2005 8:03 am

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby asmecher » Mon Dec 07, 2009 10:21 am

Hi dxmwml,

We don't use APC here, so I don't know if that will work -- but if you do try it, please post your results here in case others find it useful.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9050
Joined: Wed Aug 10, 2005 12:56 pm

Re: Problems with PHP 5.3 (Class 'HookRegistry' not found)

Postby bpedersen » Mon Oct 10, 2011 2:35 am

I experienced the same problem when running OCS 2.3.3.1 or OCS 2.3.4 (git) on php 5.3 with apc active. Deactivating apc solved the problem here.
bpedersen
 
Posts: 1
Joined: Mon Oct 10, 2011 12:39 am

PreviousNext

Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 13 guests