[PHP] Problem with PHP 5.3.3 under Debian/Squeeze

2011-03-20 Thread Michelle Konzack
Hello *,

since I have re-installed mail.tamay-dogan.net with Debian/Squeeze  on
a new machine, my /srv/log/apache/error.log ist arround 450 times bigger
then the access.log du to following (and similar) entries

[ '/srv/log/apache/error.log' ]-
[Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice:  Use of 
undefined constant DIR_BASE - assumed 'DIR_BASE' in /srv/htdocs/index.php on 
line 3
[Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice:  Use of 
undefined constant DIR_TOOL - assumed 'DIR_TOOL' in /srv/htdocs/index.php on 
line 5
[Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice:  Use of 
undefined constant DEF_DIR_TOOL - assumed 'DEF_DIR_TOOL' in 
/srv/tdphp-vserver/includes/00_main.inc on line 42
[Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice:  Use of 
undefined constant DEF_DIR_BASE - assumed 'DEF_DIR_BASE' in 
/srv/tdphp-vserver/includes/00_main.inc on line 65
[Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice:  Use of 
undefined constant DIR_HOST - assumed 'DIR_HOST' in 
/srv/tdphp-vserver/includes/00_main.inc on line 88
[Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice:  Use of 
undefined constant SCRIPT_FILENAME - assumed 'SCRIPT_FILENAME' in 
/srv/tdphp-vserver/includes/00_main.inc on line 88
snip


[ '/srv/htdocs/index.php' ]-
?php

define(DIR_BASE, /srv);

define(DIR_TOOL, /srv/tdphp-vserver);
include DIR_TOOL . /includes/00_main.inc;

?


Maybe I am sitting on the line?  This index.php file and the website  is
working since ages.

Whats the name of the error loging setting which produce this and WHY are
they now reported?

I have switched off anything but it continue to create more then 46 GByte
error files (18) per day.

Also I get

[ '/srv/log/apache/error.log' ]-
[Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice:  
Undefined offset: 1 in /srv/tdphp-vserver/includes/04_l10n.inc on line 56
[Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice:  
Undefined offset: 1 in /srv/tdphp-vserver/includes/04_l10n.inc on line 56
[Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice:  
Undefined offset: 1 in /srv/tdphp-vserver/includes/04_l10n.inc on line 56
[Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice:  
Undefined variable: locale in /srv/tdphp-vserver/includes/04_l10n.inc on line 74
[Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice:  
Undefined index: what in /srv/tdphp-vserver/includes/00_main.inc on line 249
[Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice:  
Undefined index: csslink in /srv/tdphp-vserver/includes/00_main.inc on line 284
[Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice:  
Undefined index: cookie in /srv/tdphp-vserver/includes/00_main.inc on line 298


[ '/srv/tdphp-vserver/includes/04_l10n.inc' ]---
[0051] if ( $_SERVER['HTTP_ACCEPT_LANGUAGE'] != '') {
[0052]   foreach(explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $ACC1) {
[0053] $ACC2=explode(';', $ACC1);
[0054] $ACC3=explode('-', $ACC2[0]);
[0055] $LL=$ACC3[0];
[0056] $CC=strtoupper($ACC3[1]);
[0057] if ( $CC != '') {
[0058]   $LOC=$LL . _ . $CC;
[0059] } else {
[0060]   $LOC=$LL;
[0061] }
[0062] if ( stristr(  . LOCALES .  ,  $LOC ) ) {
[0063]   $TMP_FILE=LOCALE_DIR . / . $LOC . /LC_MESSAGES/ . 
$_SERVER['SERVER_NAME'] . .mo;
[0064]   if (is_file($TMP_FILE)) {
[0065] $locale=$LOC;
[0066] break;
[0067]   }
[0068] }
[0069]   }
[0070] } else {
[0071]   $locale=(isset($_GET['lang']))? $_GET['lang'] : DEFAULT_LOCALE;
[0072] }
[0073] 
[0074] T_setlocale(LC_MESSAGES, $locale);
[0075] $domain=$_SERVER['SERVER_NAME'];
[0076] T_bind_textdomain_codeset($domain, $encoding);
[0077] T_bindtextdomain($domain, LOCALE_DIR);
[0078] T_textdomain($domain);
[0079] /* *** END gettext stuff 
*** */
[0080] ?
-

[ '/srv/tdphp-vserver/includes/00_main.inc' ]
[0248] /*   DISPLAY admin  * */
[0249] if ( $_POST['what'] == 'admin' ) {
[0250] 
[0251]   function do_auth() {
snip
[0283] /* ***  FIX CSS   */
[0284] if ($_GET['csslink'] != '') {
[0285]   if ($_GET['csslink'] == 'foo') {
snip
[0297] /*   SET and UNSET COOKIES  * */
[0298] if ( $_GET['cookie'] != '' ) {
[0299]   if ($_GET['cookie'] == 

Re: [PHP] Problem with PHP 5.3.3 under Debian/Squeeze

2011-03-20 Thread Stuart Dallas
On Sunday, 20 March 2011 at 18:38, Michelle Konzack wrote:
Hello *,
 
 since I have re-installed mail.tamay-dogan.net with Debian/Squeeze on
 a new machine, my /srv/log/apache/error.log ist arround 450 times bigger
 then the access.log du to following (and similar) entries
 
 [ '/srv/log/apache/error.log' ]-
 [Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice: Use of 
 undefined constant DIR_BASE - assumed 'DIR_BASE' in /srv/htdocs/index.php on 
 line 3
 [Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice: Use of 
 undefined constant DIR_TOOL - assumed 'DIR_TOOL' in /srv/htdocs/index.php on 
 line 5
 [Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice: Use of 
 undefined constant DEF_DIR_TOOL - assumed 'DEF_DIR_TOOL' in 
 /srv/tdphp-vserver/includes/00_main.inc on line 42
 [Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice: Use of 
 undefined constant DEF_DIR_BASE - assumed 'DEF_DIR_BASE' in 
 /srv/tdphp-vserver/includes/00_main.inc on line 65
 [Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice: Use of 
 undefined constant DIR_HOST - assumed 'DIR_HOST' in 
 /srv/tdphp-vserver/includes/00_main.inc on line 88
 [Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice: Use of 
 undefined constant SCRIPT_FILENAME - assumed 'SCRIPT_FILENAME' in 
 /srv/tdphp-vserver/includes/00_main.inc on line 88
 snip
 
 
 [ '/srv/htdocs/index.php' ]-
 ?php
 
 define(DIR_BASE, /srv);
 
 define(DIR_TOOL, /srv/tdphp-vserver);
 include DIR_TOOL . /includes/00_main.inc;
 
 ?
 
 
 Maybe I am sitting on the line? This index.php file and the website is
 working since ages.

The first parameter of the define function should be a string.

 Whats the name of the error loging setting which produce this and WHY are
 they now reported?

It would appear that your new server has defaulted to logging PHP notices. You 
can turn this off in your php.ini, or better yet fix the issues that are 
causing them. In my experience notices can often indicate more serious 
potential bugs.

 I have switched off anything but it continue to create more then 46 GByte
 error files (18) per day.
 
 Also I get
 
 [ '/srv/log/apache/error.log' ]-
 [Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice: 
 Undefined offset: 1 in /srv/tdphp-vserver/includes/04_l10n.inc on line 56
 [Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice: 
 Undefined offset: 1 in /srv/tdphp-vserver/includes/04_l10n.inc on line 56
 [Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice: 
 Undefined offset: 1 in /srv/tdphp-vserver/includes/04_l10n.inc on line 56
 [Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice: 
 Undefined variable: locale in /srv/tdphp-vserver/includes/04_l10n.inc on line 
 74
 [Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice: 
 Undefined index: what in /srv/tdphp-vserver/includes/00_main.inc on line 249
 [Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice: 
 Undefined index: csslink in /srv/tdphp-vserver/includes/00_main.inc on line 
 284
 [Thu Mar 17 00:14:16 2011] [error] [client 89.204.153.240] PHP Notice: 
 Undefined index: cookie in /srv/tdphp-vserver/includes/00_main.inc on line 298
 
 
 [ '/srv/tdphp-vserver/includes/04_l10n.inc' ]---
 [0051] if ( $_SERVER['HTTP_ACCEPT_LANGUAGE'] != '') {
 [0052] foreach(explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $ACC1) {
 [0053] $ACC2=explode(';', $ACC1);
 [0054] $ACC3=explode('-', $ACC2[0]);
 [0055] $LL=$ACC3[0];
 [0056] $CC=strtoupper($ACC3[1]);
 [0057] if ( $CC != '') {
 [0058] $LOC=$LL . _ . $CC;
 [0059] } else {
 [0060] $LOC=$LL;
 [0061] }
 [0062] if ( stristr(  . LOCALES .  ,  $LOC ) ) {
 [0063] $TMP_FILE=LOCALE_DIR . / . $LOC . /LC_MESSAGES/ . 
 $_SERVER['SERVER_NAME'] . .mo;
 [0064] if (is_file($TMP_FILE)) {
 [0065] $locale=$LOC;
 [0066] break;
 [0067] }
 [0068] }
 [0069] }
 [0070] } else {
 [0071] $locale=(isset($_GET['lang']))? $_GET['lang'] : DEFAULT_LOCALE;
 [0072] }
 [0073] 
 [0074] T_setlocale(LC_MESSAGES, $locale);
 [0075] $domain=$_SERVER['SERVER_NAME'];
 [0076] T_bind_textdomain_codeset($domain, $encoding);
 [0077] T_bindtextdomain($domain, LOCALE_DIR);
 [0078] T_textdomain($domain);
 [0079] /* *** END gettext stuff 
 *** */
 [0080] ?
 -

Have a look at what $_SERVER['HTTP_ACCEPT_LANGUAGE'] is set to because it's 
clearly not in the format this code is expecting.

 [ '/srv/tdphp-vserver/includes/00_main.inc'