OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Logging with Apache/PHP

OJS development discussion, enhancement requests, third-party patches and plug-ins.

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

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

Logging with Apache/PHP

Postby rmichael » Fri May 02, 2008 8:14 am

I have written a test stub plugin which is not working and I am attempting to debug. However, PHP does not seem to want to tell me what is wrong.

With my plugin installed in OJSROOT/plugins/generic/testPlugin, OJS simply loads a blank screen. If I remove it, all is well.

I have attempted to turn as much logging as possible by including in my virtualhost file:

php_value error_log /var/log/php/ojs-2.1.1-test-php_error_log
php_flag display_errors on
php_flag log_errors on
php_value error_reporting 6143

Errors are written to that file because, if I remove my plugin such that OJS works again, and I add "error_log("Test error log.");" to OJSROOT/index.php, the message appears in my custom error log.

I have also added "ini_set('display_errors')..." to the top of OJSROOT/index.php, but that hasn't had any effect either.

It could be true that PHP simply isn't generating any errors, despite OJS not working properly. But something different, and broken, is happening and I need to find out what. :-)

Any advice on increasing the verbosity and debugging of either PHP or OJS?

Thanks.
rmichael
 
Posts: 113
Joined: Fri Mar 30, 2007 3:32 pm

Re: Logging with Apache/PHP

Postby asmecher » Fri May 02, 2008 9:53 am

Hi Richard,

This is a frustrating attribute of PHP -- there are certain kinds of code syntax errors that will cause PHP to simply die without error messages. Usually this happens to me when I've added the wrong number of braces, e.g. closing an extra code block or something similar. For plugins, the easiest debugging strategy is to comment out large portions of the plugin and gradually add code back in until you find out which block causes PHP to die.

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

Re: Logging with Apache/PHP

Postby jalperin » Fri May 02, 2008 10:25 am

Richard,

Another thing that has gotten me in trouble in the past, when I made my first few plugins, is that I could copy code from another plugin. If two plugins try to register with the same name, this causes OJS to die without messages.
jalperin
 
Posts: 154
Joined: Thu Jul 06, 2006 1:03 pm
Location: Buenos Aires

Re: Logging with Apache/PHP

Postby rmichael » Fri May 02, 2008 10:54 am

That really is frustrating. Thanks for the quick response!
rmichael
 
Posts: 113
Joined: Fri Mar 30, 2007 3:32 pm

Re: Logging with Apache/PHP

Postby rmichael » Fri May 02, 2008 10:58 am

Thanks Juan.

Although, I'm rather careful about copying code, especially because I prefer not to do it. It doesn't help me learn very much, it can lead to worse problems if one doesn't understand what has been copied, and I'm not easily convinced the other person has done things correctly in the first place. :-)
rmichael
 
Posts: 113
Joined: Fri Mar 30, 2007 3:32 pm


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 1 guest