php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26356 sporatic "Allowed memory size exhausted" errors
Submitted: 2003-11-21 17:21 UTC Modified: 2003-11-21 23:57 UTC
From: my-junkmail at earthlink dot net Assigned:
Status: Closed Package: *General Issues
PHP Version: 5.0.0b3-dev OS: Redhat Linux 9
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: my-junkmail at earthlink dot net
New email:
PHP Version: OS:

 

 [2003-11-21 17:21 UTC] my-junkmail at earthlink dot net
Description:
------------
I recieve the following error slightly less than half the time when I try to access any script on the server in question:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate x bytes) in Unknown on line 0

(note x is variable but usually around 100)

The only similarity I can note in the scripts that produce this error is most likely trivial: they all include lines that call fopen and fread, however the error can occur even when a script is run in such a way that control structures prevent the filesystem function lines from being reached. Furthermore, I have not tested with scripts that do not include filesystem functions. 

All the scripts in question ran fine under php < 5. By re-requesting any script several times I can usually get it to run. 

Since I can't track down the source of the error, I can't provide more detailed information...if there are specific questions about my configuration I will answer them. If someone smart thinks this could be an actual bug I might be coerced into reconfiguring --with-debug.

php.ini is the dist version. Configuration line is:
'--prefix=/usr/local/php' '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-png-dir=/usr' '--with-gd' '--with-jpeg-dir=/usr/local/lib' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-openssl' '--with-png' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=/usr' '--with-zip' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dio' '--enable-mcal' '--with-apxs2=/usr/local/apache2/bin/apxs'


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-21 19:49 UTC] my-junkmail at earthlink dot net
update: This error occurs running a current version of phpmyadmin so I don't think it is filesystem-function related.
 [2003-11-21 22:05 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


Also, read the output of "./configure --help" once.
Most of the options you use (some of them twice, with different values) are not used by PHP, do not exist or are NOT supposed to be used unless you really know what you're doing.

These are the ones mostly causing problems,
consider removing them altogether:

--with-regex=system
--enable-versioning

(latter is totally useless to you)

Also, you didn't mention what mpm you configured Apache2 to use. If you're using anything else but the 'prefork', you should reconfigure/compile it to use 'prefork'.

 [2003-11-21 23:57 UTC] my-junkmail at earthlink dot net
Built latest snapshot with a lot of the configuration options removed and the problem is solved.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Nov 29 17:00:01 2025 UTC