Problems with debugger.inc.php Problems with debugger.inc.php
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Problems with debugger.inc.php

Started by Casper, October 27, 2004, 04:22:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Casper

Following updates to my devel installs, I had problems with both installs on 1 server, as follows.

I could not log in or out.
I was getting warnings and notices, as follows;

QuoteNotice: Array to string conversion in /web/sites/14/langportrd/www.langportrd.f2s.com/galleries/include/debugger.inc.php on line 47

Warning: Cannot add header information - headers already sent by (output started at /web/sites/14/langportrd/www.langportrd.f2s.com/galleries/include/debugger.inc.php:47) in /web/sites/14/langportrd/www.langportrd.f2s.com/galleries/themes/water_drop/theme.php on line 848

Warning: Cannot add header information - headers already sent by (output started at /web/sites/14/langportrd/www.langportrd.f2s.com/galleries/include/debugger.inc.php:47) in /web/sites/14/langportrd/www.langportrd.f2s.com/galleries/themes/water_drop/theme.php on line 849

Warning: Cannot add header information - headers already sent by (output started at /web/sites/14/langportrd/www.langportrd.f2s.com/galleries/include/debugger.inc.php:47) in /web/sites/14/langportrd/www.langportrd.f2s.com/galleries/include/functions.inc.php on line 76

There were also other notices.   Changing themes did not help.

On investigating the debugger.inc.php file, the first thing I noticed is there is no closing '?>' at the end of the file.
I applied this, but it did not help.

I then commented out line 47, shown here;

Quote$this->old_handler = set_error_handler(array(&$this, 'handler'));

Commenting this out solved most of the problems, but notices are still displayed at all times, such as these;

QuoteNotice: Undefined index: cat_thumb in /web/sites/14/langportrd/www.langportrd.f2s.com/galleries/themes/water_drop/theme.php on line 1083

Note, this did not affect my devel install on my other webhost.

My php info is attached.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Andi

Hi Casper :)

maybe it's a effect from the "old" php-version 4.2.2 you use.

http://de2.php.net/manual/en/function.set-error-handler.php
QuoteNote:  Instead of a function name, an array containing an object reference and a method name can also be supplied. (Since PHP 4.3.0)
hope, I could help you... :)

kegobeer

Shouldn't be an issue, since Coppermine is supposed to work with PHP 4.1.0.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

DJMaze

If it must work on 4.1 the fix is easiliy made.

http://cvs.sourceforge.net/viewcvs.py/coppermine/devel/include/debugger.inc.php

revision 1.2 will hold an additional function that gets activated on versions of PHP prior to 4.3
There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0

Casper

#4
Well yes, it must work on all the websites coppermine currently works on.

I'm quite sure my webhost is not the only one running these older versions.

EDIT;
the new version works fine, thanks.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

jernst

FYI, This file (version 1.3 in CVS) is still missing the closing php tag.
-Joe

Casper

Thanks for your report.

Fixed and committed to devel.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

DJMaze

Quote from: jernst on November 11, 2004, 07:46:35 PM
FYI, This file (version 1.3 in CVS) is still missing the closing php tag.
It's no bug and it's totally unecesary to have the php closing tag.

The closing tag is used in PHP so you can output normal text or (x)html below it, or the other way round
<html><body>
<?php
echo 'text';
?>

</body></html>


A full PHP file without closing tags has many advantages since it must run on PHP 4.1 and up.
There's a bug somewhere in PHP and this it what it does:
- when you use a closing tag in PHP and there's a space or return (\r, \n) after the closing tag, PHP will echo the output.

Since the debugger is loaded BEFORE any html output or headers there could occure problems when there's a closing tag in that file.
problems that could occure:
- cookies not working
- header errors: "header can't be sent because output started in __FILE__ on __LINE__"

So don't gonna tell me it is wrong coding because it isn't.
To me this kind of coding is way much better then using a closing and one of the reasons is explained here.
There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0

DJMaze

Quote from: Casper on November 11, 2004, 10:25:26 PM
Thanks for your report.

Fixed and committed to devel.
Casper i disagree your fix but if you all think there must be a closing tag then please remove my moderator and developer status because i can't work with closing tags.
Why is explained above.
There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0

Casper

Whoa there DJ,

you are a far more knowledgable coder than me, I was fixing what I thought was a missing bit of code.  Unfortunately I did this before you had time to make your post, which I would have learnt from.

I will willingly remove the said 'fix', and leave such things to real coders in the future.

EDIT, file rolled back to remove end closing tag.
It's a pity no-one explained this when I mentioned it in the first post of this thread.


It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

DJMaze

NP casper, i was pissed on someone and not this thread.
I was just caried away a bit ;)
There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0

kegobeer

In case anyone is wondering, php.net says that a closing tag is optional at the end of a file.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Tarique Sani

Yes optional - but a very good practice to have one none the less
SANIsoft PHP applications for E Biz

jernst

Holy cow!  I guess I'd better think twice before putting in my two cents.  :-\\

I don't profess to be a php guru, but I'm certainly no newby and I didn't know the closing tag was optional.  Sorry if I ruffled any feathers.

-Joe
-Joe

DJMaze

Quote from: Tarique Sani on November 12, 2004, 07:00:51 AM
Yes optional - but a very good practice to have one none the less
I agree it's practical to have to understand oyur code when your learn PHP.
But as i mentioned before the closing tag could cause a lot of problems (i thought it was 4.2.2 or something)
There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0