php.net |  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
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: scott at schrecktech dot com
New email:
PHP Version: OS:

 

 [2012-12-21 20:24 UTC] scott at schrecktech dot com
Description:
------------
---
From manual page: http://www.php.net/ini.core
---

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.

EXAMPLE:

; 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 
4Gb.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-21 22:30 UTC] felipe@php.net
Please, take a look at bug #54201.
 [2012-12-21 22:30 UTC] felipe@php.net
-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-2025 The PHP Group
All rights reserved.
Last updated: Thu Apr 03 23:01:31 2025 UTC