Advanced search  

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

Pages: [1]   Go Down

Author Topic: Problems with debugger.inc.php  (Read 12330 times)

0 Members and 1 Guest are viewing this topic.

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Problems with debugger.inc.php
« on: October 27, 2004, 04:22:28 pm »

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;

Quote
Notice: 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;

Quote
Notice: 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.
« Last Edit: October 28, 2004, 10:51:01 am by Casper »
Logged
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

  • VIP
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 85
  • Join the Future
    • www.pragmamx.org
Re: Problems with debugger.inc.php
« Reply #1 on: October 27, 2004, 07:06:11 pm »

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
Quote
Note:  Instead of a function name, an array containing an object reference and a method name can also be supplied. (Since PHP 4.3.0)
Logged
hope, I could help you... :)

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Problems with debugger.inc.php
« Reply #2 on: October 28, 2004, 02:55:28 am »

Shouldn't be an issue, since Coppermine is supposed to work with PHP 4.1.0.
Logged
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

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
Re: Problems with debugger.inc.php
« Reply #3 on: October 28, 2004, 03:51:04 am »

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
Logged
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

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Problems with debugger.inc.php
« Reply #4 on: October 28, 2004, 10:39:35 am »

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.
« Last Edit: October 28, 2004, 10:50:41 am by Casper »
Logged
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

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • World Wide Garage
Re: Problems with debugger.inc.php
« Reply #5 on: November 11, 2004, 07:46:35 pm »

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

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Problems with debugger.inc.php
« Reply #6 on: November 11, 2004, 10:25:26 pm »

Thanks for your report.

Fixed and committed to devel.
Logged
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

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
Re: Problems with debugger.inc.php
« Reply #7 on: November 11, 2004, 10:26:26 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
Code: [Select]
<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.
Logged
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

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
Re: Problems with debugger.inc.php
« Reply #8 on: November 11, 2004, 10:27:50 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.
Logged
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

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Problems with debugger.inc.php
« Reply #9 on: November 11, 2004, 10:45:39 pm »

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.


Logged
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

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
Re: Problems with debugger.inc.php
« Reply #10 on: November 11, 2004, 11:09:38 pm »

NP casper, i was pissed on someone and not this thread.
I was just caried away a bit ;)
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Problems with debugger.inc.php
« Reply #11 on: November 12, 2004, 12:51:15 am »

In case anyone is wondering, php.net says that a closing tag is optional at the end of a file.
Logged
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

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Re: Problems with debugger.inc.php
« Reply #12 on: November 12, 2004, 07:00:51 am »

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

jernst

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • World Wide Garage
Re: Problems with debugger.inc.php
« Reply #13 on: November 12, 2004, 02:38:39 pm »

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
Logged
-Joe

DJMaze

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
Re: Problems with debugger.inc.php
« Reply #14 on: November 12, 2004, 08:20:56 pm »

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)
Logged
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
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 19 queries.