Understanding PHP memory limits
Why the default memory_limit is conservative, when raising it is right, and why a site needing 1GB has a different problem.
memory_limit caps how much memory a single PHP script may allocate. Applies to
shared, reseller and Premium hosting.
The default in Select PHP Version is deliberately lower than the maximum available.
Why the default is conservative
The limit is a safeguard. Without it, one runaway script — an infinite loop, an unbounded query result — allocates until the server has nothing left, taking down every account on it.
A conservative default is sufficient for the great majority of sites, and it means a fault in one script stays contained.
Raising it
cPanel → Select PHP Version → Options — see Change your PHP version and settings.
Reasonable reasons to raise it:
- Importing a large file or database through a web interface
- Image processing on large uploads
- A WooCommerce store with a big catalogue
- An application that documents a higher requirement
Raising memory_limit does not raise your account's memory limit. That is
set by your plan, and it is what produces 503 errors — see
CloudLinux and LVE limits explained.
Setting memory_limit above your account's allocation achieves nothing: the
script is killed at the account limit regardless.
When raising it is the wrong answer
A normal page load should not need hundreds of megabytes. WordPress serving a page comfortably fits in 128–256 MB. If a site needs 1 GB to load its homepage, the limit is not the problem — something is loading far more than it should.
Usual causes:
- A plugin querying without limits, loading an entire table into memory
- An unbounded loop accumulating data
- Image processing on every request rather than once at upload
Trace it before raising anything — PHP X-Ray shows where the work is going. Raising the limit hides the symptom, and the underlying problem consumes your account's CPU and entry processes as well.
Resellers
Resellers cannot raise the default applied to new accounts — that is set server-side. Individual accounts can be changed within their allocation as above, and Resource Boost+ raises the ceiling for one account.
Check what is actually applied
<?php echo ini_get('memory_limit');Delete the file afterwards. On Bolt-Cache, the PHP Selector is ignored entirely
and the value comes from .user.ini — see
Change your PHP version and settings.