Veröffentlicht 1. Juli 200322 j Hallo, ich habe ein PHP-Script auf einem Linux-Rechner laufen. Dort funktioniert alles. Jetzt habe ich versucht, das glaiche unter Windows zum Laufen zu bringen. Den Server (Apache mit PHP Version 4.3.0) habe ich selbst konfiguriert. Folgendes Script: <?PHP $zeit = time(); // Aktuelle Zeit in Sekunden $datum = getdate(); echo $datum[seconds] . "<br>"; echo $datum[minutes] . "<br>"; echo $datum[hours] . "<br>"; echo $datum[mday] . "<br>"; echo $datum[wday] . "<br>"; echo $datum[mon] . "<br>"; echo $datum[year] . "<br>"; echo $datum[yday] . "<br>"; echo $datum[weekday] . "<br>"; echo $datum[month] . "<br>"; ?> bringt folgende Fehlermeldung: Notice: Use of undefined constant seconds - assumed 'seconds' in c:\apache_group\apache\htdocs\mytest.php on line 4 15 Notice: Use of undefined constant minutes - assumed 'minutes' in c:\apache_group\apache\htdocs\mytest.php on line 5 49 Notice: Use of undefined constant hours - assumed 'hours' in c:\apache_group\apache\htdocs\mytest.php on line 6 15 Notice: Use of undefined constant mday - assumed 'mday' in c:\apache_group\apache\htdocs\mytest.php on line 7 1 Notice: Use of undefined constant wday - assumed 'wday' in c:\apache_group\apache\htdocs\mytest.php on line 8 2 Notice: Use of undefined constant mon - assumed 'mon' in c:\apache_group\apache\htdocs\mytest.php on line 9 7 Notice: Use of undefined constant year - assumed 'year' in c:\apache_group\apache\htdocs\mytest.php on line 10 2003 Notice: Use of undefined constant yday - assumed 'yday' in c:\apache_group\apache\htdocs\mytest.php on line 11 181 Notice: Use of undefined constant weekday - assumed 'weekday' in c:\apache_group\apache\htdocs\mytest.php on line 12 Tuesday Notice: Use of undefined constant month - assumed 'month' in c:\apache_group\apache\htdocs\mytest.php on line 13 July Vermutlich muss ich die Konfiguretionsdatei ändern. Aber wie? Vielen Dank! Gruß Walter
1. Juli 200322 j Hi! Also bei mir läuft das Script einwandfrei! Aber versuch mal ob so auch deine Fehlermeldungen auftreten: echo $datum['seconds'] . "<br>\n"; [/PHP] usw... Zur Konfiguration kann ich dir leider (noch) nichts sagen! Gruß Azrael
2. Juli 200322 j Also DAS kann auch nicht auf nem Linux-Rechner funzen, oder die Konfig ist da falsch. Wolltest du nicht eher $datum=getdate(time()); schreiben?
2. Juli 200322 j Hallo, also das Script läuft problemlos auf einem Linux-Rechner. Denn dort habe ich es schon laufen. Ich habe jedoch einen Irrtum in der Versionsnummer entdeckt: PHP 4.3.0 Nach Installation von 4.3.2 ist der datumsfehler jetzt behoben, ... Keine Ahnung warum. Vielen Dank für die Antworten! Gruß Walter
8. Juli 200322 j Der Unterschied liegt wohl eher daran, dass auf deinem Windows-PHP das error_reporting() etwas strikter eingestellt ist. Guck mal im handbuch nach, wie du den Level ändern solltest. Aber besser ist es, wenn du die Warnungen im Skript behebst und nicht den Error-Level anpasst. Gruss Joerg
Archiv
Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.