Yoksa satır sayısına PHP Fatal error

4 Cevap php

Fatal error: in (523800 bayt ayırmaya çalıştı) tükenmiş 134217728 bayt İzin bellek boyutu /Library/WebServer/Documents/XMLDataStore.class.php on line 981

Bu hata ile ilgili merak şey gidermek için yeterli kolay olurdu bellek sızıntısı, değil. Aksine, bu XMLDataStore.class.php birden çok metin editörleri doğruladıktan uzun yalnızca 850 satır olduğunu gerçektir.

Bu Snow Leopard ile birlikte PHP 5.3 ile. Ben bir opcode önbellek kullanarak değilim. İşte benim php.ini:

allow_url_fopen = Off
error_reporting = -1
display_errors = 1
display_startup_errors = 1
date.timezone = 'America/Los_Angeles'
output_buffering = Off
realpath_cache_size = 0k

XMLDataStore.class.php son zamanlarda tekrar elden geçirildi ve 981 satırdan uzun olması için kullanılır. PHP bir 2 haftalık bir sürümünü önbelleğe ve bu okuma Sanki bulunuyor. I / Library / WebServer / belgeler / XMLDataStore.class.php en güncel sürümü olsa da, sadece 850 satır uzunluğundadır olumlu değilim.

4 Cevap

Could this be a line break issue? i.e. the PHP interpreter breaking lines differently than your IDE / editor? I don't know about how PHP handles Linux/Mac/Windows linebreaks, but it might be a possibility. Can you create a fatal error somewhere in the script, and look which line number it shows you?

Kodunuzda bazı aşırı uzun çizgiler (> 65535 karakter) o hat sayım karıştırmak olabilir mi?

Dosyayı yeniden adlandırmak ve yeni bir isim altında eklerseniz de ne olur? Bu herhangi mahvettim önbellek konularda dikkat çekmek gerekir.

If you are getting an error on a non-existant line then it may very well be that PHP is caching it. Maybe try renaming it then executing it.

Snow Leopard hakkında emin, ama yalnız OS ile garip hataların büyük bir anlaşma olduğunu söylemek için şu anda kullanıyorum ve sahip etmiyorum, o olabilir.

I experienced this error before when I was accessing a DB and storing info in an array, turns out I forgot how large the DB was and when it passed MB on the stack I got that error and it stopped. If the situation is similar use a more processor heavy approach, such as connect, get a line/ block/ whatever, to something, then go back. Don't go through everything, store it all, then do something.

Check this out: Drupal.org memory allocation error

Hope this helps, not sure how clear all of this is. Maybe show parts of your script to get an idea of what might be causing this.

Burada biraz daha bilgi. Aynı sonucu - nadiren gelişimi için kullanılır ve bu dosya önbelleğe bir sürümüne sahip olmaz bir - Ben Snow Leopard aynı sürümünü çalıştıran farklı bir Mac üzerinde aynı kodu çalıştı.

Sonraki PHP 5.2.8 çalıştıran bir Solaris kutusuna aynı kodu kopyalama çalıştı. Halen mevcut bu yana, elbette, ince ve beklenen - - Hala bellek hatası olsun ama PHP hata mesajı yerine bu diyor ki:

Fatal error: Maximum function nesting level of '100' reached, aborting! in /export/www/htdocs/XMLDataStore.class.php on line 741

Başka bir yöntemle ardışık çağrıldığını bir yöntemin ilk satırı olduğu gibi bu mükemmel mantıklı. Aynı satır sonları (LF) ile tam aynı kod 3 makinelerde aynı SVN deposundan aynı revizyon # teslim.

PHP hata Snow Leopard için 5.3.0? :)

While I have no idea what may cause this wrong line counting (I'm using PHP 5.3 on OSX 10.6, too. No Problems here.), you can narrow down the actual error by dividing your script into smaller parts. that way maybe you'll find the real location of your error.

Ve 850 satırı PHP dosyası ciddiye yine bazı üstlenmeden kullanabilirsiniz.