|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63831 Specific 4G/4096M/4194304K memory_limit Fatal Error
Submitted: 2012-12-21 20:24 UTC Modified: 2012-12-21 22:30 UTC
From: scott at schrecktech dot com Assigned:
Status: Not a bug Package: *Configuration Issues
PHP Version: Irrelevant OS: Multiple
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
30 - 22 = ?
Subscribe to this entry?

 [2012-12-21 20:24 UTC] scott at schrecktech dot com
From manual page:

PHP will not run with a 4G, 4096M or 4194304K

PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 
523800 bytes) in Unknown on line 0

Test script:
Change the memory_limit from the byte value to the "K", "M" or "G" version of 4Gb to see fatal error.


; works:
memory_limit = 4294967296

; fails:
;memory_limit = 4G
;memory_limit = 4096M
;memory_limit = 4194304K

Expected result:
One should be able to set the memory_limit with the "G", "M" and "K" versions of 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-21 22:30 UTC]
Please, take a look at bug #54201.
 [2012-12-21 22:30 UTC]
-Status: Open +Status: Not a bug
 [2012-12-28 17:06 UTC] scott at schrecktech dot com
bug #54201 does show the same issue, but this entry below identifies that it is explicitly at a unique value where the bug occurs, not using the byte value.
 [2012-12-28 19:40 UTC] scott at schrecktech dot com
The "zend_alloc.c" shows the error condition being hit when setting the 
memory_limit with non-byte value equal to 4G.  

may be the differences in line 1965 and line 2276?  A debug build may show the 
filename and line number?
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 13:01:29 2024 UTC