Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP und Windows

Empfohlene Antworten

Veröffentlicht

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

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

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

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.