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] Allowed memory size of 123 bytes exhausted

Empfohlene Antworten

Hi,

hab grad n Fehler auf den ich bisher noch nicht gestoßen bin

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 129 bytes) in /var/www/html/controll.php on line 37

Die Funde in Google sagten nur das man die "max_execution_time" und den "memory_limit" höher setzen soll.... gesasgt getan, execution_time von 30 auf 120 und memory_limit von 8 auf 32 erhöht, doch trozdem kommt die meldung noch :/

Alles was in Zeile 37 + drumherum passiert ist:


$controller_global_file = "/absoluter_pfad/controller_lokal.conf";
//------------------------------------------
$configfile = fopen($controller_global_file,"r");
while(!feof($file)){
array_push($globalconfig,fgets($configfile));
}[/php]

Die zu lesende Datei ist grad mal 318 Byte groß, also wieso sollte der Speicher nicht ausreichen? Immerhin kann ich in einem anderen Modul des Skripts eine DAtei auslesen die fünf mal so groß ist.

also diese lustige meldung hatte ich auch mal und zwar bei der erstellung und ausgabe meiner sektorkarte (von meinem browserspiel)

lag daran, dass sehr viele user die seite aufriefen und die datenbankabfragen und der scriptaufbau einfach nur schlecht waren -> hohe laufzeit und hoher speicherbedarf -> meldung

hab das script und den datenbankaufbau optimiert und das problem war gelöst

ich weiss...nicht wirklich ne lösung aber vielleicht kannste ja bei dir ja auch noch was optimieren ;)

Hallo SNOWMAN,

Dateihandle ist "$configfile" und in der while-Bedingung steht !feof($file)) drin. Merkst du was?

Du überprüfst den Dateizeiger einer anderen offenen Datei aber nicht von $configfile -> also Endlosschleife :-)

Gruß

xmurrix

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

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.