By NigelFK on
Hi All,
Please take a look at this...
...which is currently giving a "Warning: Missing argument 5 for drupal_error_handler() in..." error.
I got this error on Drupal V6.5 so upgraded to 6.6 whereupon it vanished only to reappear a few days later. Does anyone have any idea why this might be?
Cheers,
Nigel
Comments
hmmm
I'm not an expert but:
line 583 in common.inc
* Error levels:
* - 0 = Log errors to database.
* - 1 = Log errors to database and to screen.
*/
Check your settings.php maybe there is something there about error levels
Actually line 583 is this:
Actually line 583 is this: http://cvs.drupal.org/viewvc.py/drupal/drupal/includes/common.inc?annota...
Looks like PHP is invoking the error handler but not supplying the (optional) fifth argument. You may have found a bug in Drupal. What happens if you make a backup of includes/common.inc and then modify line 583 to read:
I'm guessing the real error occurring on the site will get logged to the watchdog log.
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Oh well...
At least I tried to help...was pretty close though!
It is a bug
The $filename, $line, $context should all be optional. @see http://php.net/set-error-handler
Eg:
Alan Davison
www.caignwebs.com.au
Alan Davison
Indeed. I'm hoping that the
Yes, presumably that means all 3 should have defaults specified?
I'm hoping that the op will post back as to whether the suggested change helped, then we can get this fixed in core.
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Looks good everyone... thanks!
As directed I changed line 583 to this...
function drupal_error_handler($errno, $message, $filename, $line, $context = NULL) {
...and it seems to work!
Regards,
Nigel
Glad that's fixed it,
Glad that's fixed it, presumably you got some errors in your dblog/watchdog?
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Sorry, I'm a newbie...where
Sorry, I'm a newbie...where do I look for these logs?
Administer -> Reports ->
Administer -> Reports -> Recent log entries
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
I've checked and there are a
I've checked and there are a LOT of (trivial) entries in the log and it might take quite a while to find the necessary entries. But, if it is important I'll do it so let me know if I should.
Regards,
Nigel
All I was getting at was
All I was getting at was that your original problem was caused by a PHP error (this is why Drupal's error handler was being invoked) which could indicate a problem with your site. Any such errors are logged to the "Recent log entries page" - try filtering by PHP messages if you are concerned.
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Okay, thanks. This is a log
Okay, thanks. This is a log entry (one of many) for the error...
parse_url(http:///index.php?q=admin/reports/request-test) [function.parse-url]: Unable to parse url in /hsphere/local/home/nigelfra/fenella.fraserker.com/includes/common.inc on line 436.
To my inexperienced eye it looks like the sort of thing I would have expected given the above diagnosis.
Cheers,
Nigel
That's odd .. there seems to
That's odd .. there seems to be an extra / after the http:
Actually the domain name is missing. I guess it should be fenella.net? Looks like this may be a Windows-related issue. Have you defined $base_url in your settings.php file (usually that line is commented out)? If not then maybe Drupal is calculating it incorrectly.
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
When you google for that
Thanks, the same worked for me too.
However, when you google for that error message you will notice that they all seem to stem from the same isp system: /hsphere/local/home/
so whatever hsphere is, it's causing this error message.
hsphere = Host Excellence
Yes, the domain name is fenella.net
I guess that hsphere must be the Host Excellence server that I'm running the site on. I will draw their support team's attention to this thread and see if they can shed any light on the problem.
Cheers,
Nigel
Fixed the same problem
I too have a site on hsphere/../.. with the same error, I replaced the line and its seems to work here.
I figure it has something to do with the flash node module as these are the only page I encountered these errors
Thanks,
Derek
>I figure it has something
>I figure it has something to do with the flash node module
Interesting. Perhaps the flash applet generates HTTP requests that don't specify the HTTP_HOST (in contravention of some RFC...).
So I reckon there could be a 2nd bug here - Drupal shouldn't fall over in this way if HTTP_HOST is not defined. There are other clients that could cause this to happen.
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
It can fall over..
@see http://drupal.org/node/346285
Alan Davison
www.caignwebs.com.au
Alan Davison
Yes I thought I'd seen an
Yes I thought I'd seen an issue about this ... is the $base_url problem a separate issue though?
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
I don't think so
As far as I known you can not generate the $base_url without the host variable using PHP. I haven't read through the HTTP specs, but found this on the web earlier:
The server may be running as a cgi, and there may be some environment variables set that will have this info, but I generally follow the KISS principle, so best just to set the base url in settings.php
Alan Davison
www.caignwebs.com.au
Alan Davison
Fair enough, I think what I
Fair enough, I think what I was groping towards was that while #346285: Drupal 5.14 & Drupal 6.8 will not load on clients that do not transmit HTTP_HOST fixes part of the problem with requests from HTTP/1.0 clients, the problem at comment-1133684 may still arise if $base_url is not hard-coded (it seems to occur in http://api.drupal.org/api/function/drupal_http_request/6). If so then I guess it will rear its ugly head soon enough.
I think you may be saying much the same thing.!
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Maybe check the $_SERVER variables
After tracing through the code, I think I found where this error is happening:
Firstly, since $base_url is not being set, Drupal calculates it as:
Then latter when Drupal tries to clear 'drupal_http_request_fails' variable, it triggers the URL given above, with the absolute flag set, which uses the falsely defined $base_url.
OK, long story short, is $_SERVER['HTTP_HOST'] being set correctly?
Alan Davison
www.caignwebs.com.au
Alan Davison