Not logged in. · Lost password · Register
Forum: Support Installation, update and import RSS
undefined constant - cannot modify header - einen Haufen Fehler - wieso?
lots of error (although all files by webserver and 775) - what user rights have to be there for which files / directories?
hihat #1
Member since Dec 2005 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: undefined constant - cannot modify header - einen Haufen Fehler - wieso?
Liebe Entwickler / Mitbenutzer

Ich habe mich für das ucn entschieden, weil auf omspace.org sehr schön implementiert gefunden.
Ich verwende selber grad php5.1.1 auf debian. Weitere Infos bei Bedarf.

Nun finde ich bei jedem Seitenaufruf folgendes in den apache-logfiles.
Dabei habe ich - wobei ich das gar nicht gerne machte - alle Files auf den Owner Webserver und 775 gesetzt. Gibt's eine Übersicht, welche Verzeichnisse/Dateien wie gesetzt sein müssen, damit ich mit den Berechtigungen zurückbuchstabieren kann?

Die Auswirkungen kenn' ich noch nicht, da ich das Board eh noch nicht im Griff habe.
PHP5 sollte ja keine Probleme machen, gemäss Autoerkennung in common.lib.php.

Vielen Dank für Eure Hilfe.

[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_ALL - assumed 'ABBC_ALL' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 20
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_PARAGRAPH - assumed 'ABBC_PARAGRAPH' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 20
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_HTML - assumed 'ABBC_HTML' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 20
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Undefined variable: ABBC in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 36
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_DONTINT - assumed 'ABBC_DONTINT' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 88
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_DONTINT - assumed 'ABBC_DONTINT' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 104
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_CODE - assumed 'ABBC_CODE' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 125
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_QUOTE - assumed 'ABBC_QUOTE' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 160
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_SIMPLE - assumed 'ABBC_SIMPLE' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 176
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_SIMPLE - assumed 'ABBC_SIMPLE' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 192
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_SIMPLE - assumed 'ABBC_SIMPLE' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 208
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_SIMPLE - assumed 'ABBC_SIMPLE' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 224
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_SIMPLE - assumed 'ABBC_SIMPLE' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 244
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_SIMPLE - assumed 'ABBC_SIMPLE' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 260
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_URL - assumed 'ABBC_URL' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 284
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_URL - assumed 'ABBC_URL' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 304
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_IMG - assumed 'ABBC_IMG' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 324
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_SIMPLE - assumed 'ABBC_SIMPLE' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 340
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_FONT - assumed 'ABBC_FONT' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 356
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_FONT - assumed 'ABBC_FONT' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 380
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_FONT - assumed 'ABBC_FONT' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 400
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_FONT - assumed 'ABBC_FONT' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 416
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_FONT - assumed 'ABBC_FONT' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 432
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_FONT - assumed 'ABBC_FONT' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 448
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_FONT - assumed 'ABBC_FONT' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 464
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_SIMPLE - assumed 'ABBC_SIMPLE' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 488
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_FONT - assumed 'ABBC_FONT' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 508
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_LIST - assumed 'ABBC_LIST' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 524
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_LIST - assumed 'ABBC_LIST' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 540
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_LIST - assumed 'ABBC_LIST' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 556
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_TABLE - assumed 'ABBC_TABLE' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 576
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_TABLE - assumed 'ABBC_TABLE' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 592
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_TABLE - assumed 'ABBC_TABLE' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 616
[Wed Dec 21 04:16:14 2005] [error] PHP Notice:  Use of undefined constant ABBC_HTML - assumed 'ABBC_HTML' in /var/www/web11/html/forum/unb_lib/abbc.conf.php on line 632
[Wed Dec 21 04:16:14 2005] [error] PHP Warning:  Cannot modify header information - headers already sent by (output started at /var/www/web11/html/forum/unb_lib/abbc.conf.php:20) in /var/www/web11/html/forum/unb_lib/abbc.css.php on line 17
[Wed Dec 21 04:16:14 2005] [error] PHP Warning:  Cannot modify header information - headers already sent by (output started at /var/www/web11/html/forum/unb_lib/abbc.conf.php:20) in /var/www/web11/html/forum/unb_lib/abbc.css.php on line 18

Danke.
David
Avatar
Yves (Administrator) #2
User title: UNB developer & webmaster
Member since Jan 2004 · 3864 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hallo David,

das UNB läuft problemlos unter PHP 5.0, meiner Entwicklungsumgebung daheim. Was jetzt mit PHP 5.1 ist, weiß ich nicht, hab es noch nicht installiert.

Die Fehlermeldungen, die du angegebenen hast, haben mit den Dateirechten nichts zu tun. Das Ändern der Dateirechte ist im übrigen auch wirklich nur dann notwendig, wenn es die Webserver-Konfiguration erfordert. Dann kann man aber auch nichts dagegen tun, außer dem Server-Admin mal nen Crashkurs in Computersicherheit anzubieten. Eine Übersicht aller in dem Fall zu setzenden Dateirechte befindet sich in der Installationsanleitung auf dieser Webseite. Gleich unter "Dokumentation", sollte nicht zu verfehlen sein.

Dass PHP "Notices" als "error" ausgibt, ist sehr merkwürdig. Vor allem, da die Meldungen noch völlig unsinnig sind ("kenne ABBC_ALL nicht, meinst du das ABBC_ALL, das ich kenne?"). Das Loggen von PHP Notices wird im Code außerdem explizit deaktiviert. Irgendwas ist da also in der PHP-Konfiguration quer. Falls das möglich ist, versuch doch bitte mal, die Standardkonfiguration von PHP zu verwenden (php.ini.recommended).
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
hihat #3
Member since Dec 2005 · 2 posts
Group memberships: Members
Show profile · Link to this post
Danke für die Hinweise.

>meinst du das ABBC_ALL, das ich kenne?
keine Ahnung, php meint etwas, ich meine schon, dass es meint, was Du meinst.
Wo wird das Loggen der PHP Notices deaktiviert, in einem Skript selber mit ini_set? Was muss dann dafür erfüllt sein?
In der .htaccess finden sich ja im wesentlichen nur rewrite-Direktiven.


Ich hab' eigtl. ganz normale und saubere php5.1-Umgebung, kann aber php.ini nicht überschreiben weil "virtual shared hosting".

->PN.

Grüss Dich

David
Avatar
Yves (Administrator) #4
User title: UNB developer & webmaster
Member since Jan 2004 · 3864 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Das Ausgeben von E_NOTICE-Meldungen wird in forum.php eingestellt:
  1. error_reporting(E_ALL & ~E_NOTICE);
Es ginge auch mit ini_set. Soweit ich weiß, lässt sich der Aufruf von error_reporting nicht administrativ unterbinden, allerdings sollte das bei ini_set auch nicht gehen und ein Benutzer hat hier bereits berichtet, dass es bei ihm nicht ging. Da PHP open-source ist, kann der Serveradmin PHP natürlich beliebig verändern, was eine sinnvolle Programmierung aber nicht gerade erleichtert.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Chris #5
Member since May 2007 · 14 posts · Location: USA - West coast
Group memberships: Members
Show profile · Link to this post
Greetings,
 I am multilingual - PHP,PERL,C,C++,(X)HTML,XML,JS,etc, etc... However, the only human language I speak/read
is the english language. :)
So I ran this thread through http://www.babelfish.altavista.com/babelfish/tr in an attempt to get a better understanding.
But most of babelfish's output was nonsense.
I am writing this reply because I am recieving the same output in my server (apache-1.3.x) logs.
I am using the current (dev) version of UNB.

System:
OS - UNIX
PHP - 4.4.x
Server - Apache 1.3.x
MySQL - 4.1.x


I should note that inspite of the errors found in the log, the board seems to work as intended/expected.
Just thought I'd mention it, in case it is related to bug #309. Or in case there is anything I need to fix/correct
in my configuration.

Thanks for all your time and consideration.
Thank you Yves, for this very fine software, and your continued support.

--Chris

P.S. I should also note that I only recieve messages prefaced with:
Use of undefined constant

Not "cannot modify header"
Avatar
Yves (Administrator) #6
User title: UNB developer & webmaster
Member since Jan 2004 · 3864 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Chris, did you try the error_reporting() call mentioned above?
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Chris #7
Member since May 2007 · 14 posts · Location: USA - West coast
Group memberships: Members
Show profile · Link to this post
Yves, thank you for your reply.
 I'm afraid I am unable to read/write Deutsch.
Of course I see and understand the error_reporting() call - error_reporting(E_ALL & ~E_NOTICE); as it's written
in your earlier reply. I guess, given that I am unable to read it's context in your earlier reply to hihat,
my only question is where I should add this, or where it's already located. Of course I know I can make this
change in php.ini. I had no errors in my logs until UNB. So I assume I need to make the correct change somewhere
in the UNB source. I didn't notice any reference in the board.conf.php file.

I hope I am making sense to you. :)

Thank you again for taking the time to reply.

--Chris

P.S. Since I'm already directing all errors to a log file. This doesn't affect the page output. It just makes the log files
a bit "noisier". The errors appear to be harmless. I was mostly interested in confirming it, and wondered if I could
make any changes to the source. Like change a $GLOBAL to a $_SESSION, or $_SERVER to shut it up. :)

A search in common.lib.php reveals:


// We don't want error messages to be displayed from now on

if (!defined('ERR_REPORT_SET')) error_reporting(E_ALL & ~E_NOTICE);
if (!defined('DISPLAY_ERR_SET')) @ini_set('display_errors', 0);


I'm guessing this is the one you refer to. While I could comment the two lines out, which should cause my php.ini
settings to be chosen. I still wonder if I can make PHP happy (as suggested in P.S. above).

Thanks again for your time.
This post was edited 2 times, last on 2007-11-15, 08:17 by Chris.
Avatar
Chris #8
Member since May 2007 · 14 posts · Location: USA - West coast
Group memberships: Members
Show profile · Link to this post
Update:

I simply single quoted all variables mentioned in the error log. All errors disappeared except one:

Undefined variable:  ABBC in unb_lib/abbc.conf.php


This is on line #36

// set of smilies (directory name)
'smileset' => $ABBC['Config']['smileset'],


Which, as you can see, I've left unquoted.
Avatar
Yves (Administrator) #9
User title: UNB developer & webmaster
Member since Jan 2004 · 3864 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You quoted all variables/constants throughout the UNB source code? Well, that's probably a bad idea because all your changes will be lost on any upgrade. Also, all of this seems to be E_NOTICE errors. Well, PHP calls it "error" but it's no error, it's not even a warning, it's PHP telling me something that I already know and want to be like that. That stupid PHP should finally shut up telling me that an array index doesn't exist - I perfectly know that myself and will handle that if appropriate. As I've surely mentioned somewhere before: Why should I do all those checks in unperformant PHP code if PHP does it already itself in native machine code? It's not that the programme would crash because of such things.

The lines you've found in common.lib.php are just a fallback to do that setting if it wasn't before. The actual first place (which a grep/find in files could have revealed) is forum.php. Check if your line 44 (error_reporting(...)) is still there. This is where this PHP setting should be done.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Avatar
Chris #10
Member since May 2007 · 14 posts · Location: USA - West coast
Group memberships: Members
Show profile · Link to this post
Greetings Yves. Thanks for taking the time to respond.

I regret that I was not more clear with you. :|
Where I quoted the variables/constants was only in file: unb_lib/abbc.conf.php

Indeed. These modifications will get clobbered during an upgrade. But in anticipation of this, I keep a log
of any modifications I make to the original source and also create DIFF's as well. Making reversal a trivial task
should I break anything, or should I need the original source during an upgrade. :)

Yes, it was my understanding that these were probably trivial/harmless messages in the log files. But I inquired
here for confirmation/suggestion(s), having found this seemingly related thread.

Thank you for pointing me to correct file with the (error_reporting(...)) line.

My forum.php (without having made any changes) reads:

// We don't want E_NOTICE output here!
error_reporting(E_ALL & ~E_NOTICE);


Indeed. I should have simply performed:

grep -rli 'error_reporting' unb/ >> /path/to/unb/folder/FOUND


But wasn't sure how many, and/or which was the proper one to change/modify.

Please accept my sincere apologies if this seemed a stupid question.

Thank you again for all your time and consideration.

--Chris
Avatar
Yves (Administrator) #11
User title: UNB developer & webmaster
Member since Jan 2004 · 3864 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Never mind. :) I hope this has helped you to resolve the issue.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
jense #12
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Since abbc.css.php is a stand-alone file, can something along the lines
// We don't want E_NOTICE output here!
error_reporting(E_ALL & ~E_NOTICE);
be inserted - just like in unb_lib/designs/modern/cssconfig.php?
Alala, Alala, Gimme three wishes - CSS
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Page created in 262.1 ms (215.5 ms) · 121 database queries in 122.5 ms
Current time: 2014-10-25, 14:37:31 (UTC +02:00)