PHP Memory Limit Explained: How Much Does Your Website Need?

Disclosure: HostScore may earn commissions from our links, and some providers pay for featured placement on selected pages. Testing and performance data are collected independently (see our methodology). Prices are in USD unless stated otherwise.

Table of Content

Ask AI about this page:
ChatGPT
Claude
Perplexity
Grok
Google AI

The PHP memory limit controls how much server memory one PHP script can use. Most WordPress websites work with 128 MB to 256 MB, while WooCommerce stores, membership sites, page builders, and large imports may need 256 MB to 512 MB.

More PHP memory does not automatically make a website faster. Speed and traffic capacity also depend on CPU, total RAM, database performance, caching, and PHP concurrency.

What Is the PHP Memory Limit?

The PHP memory limit is the maximum amount of memory that a single PHP script can allocate during one execution. PHP controls this allowance through the memory_limit directive. A PHP process with a 256 MB limit cannot allocate more than 256 MB while generating a page, importing products, or resizing images. PHP stops the process after it exceeds that ceiling.

Web hosts enforce this limit to stop one faulty script from consuming excessive server resources. This protection is particularly important in shared hosting, where multiple customers use the same physical server.

PHP memory is related to several other hosting resources, but the terms are not interchangeable.

ResourceWhat It Controls
PHP memory limitMaximum memory one PHP script can allocate
WordPress memory limitAmount of PHP memory WordPress requests for normal operations
WordPress admin memory limitHigher amount WordPress can request for administration tasks
Server RAMMemory available to the complete hosting environment
PHP workers or threadsNumber of uncached PHP requests processed concurrently

Kinsta illustrates this distinction by listing memory per PHP thread separately from the number of threads and total PHP pool size (see screenshot below). More memory helps an intensive request complete, while more threads increase concurrent PHP processing. WordPress cannot override the host’s PHP ceiling. Setting WP_MEMORY_LIMIT to 512 MB provides no more than 256 MB when the server caps each process at 256 MB.

Example: Kinsta explains PHP memory as a per-thread limit, meaning each PHP thread can use memory up to the plan’s allowed amount while PHP workers control how many requests can run at the same time.

How Much PHP Memory Does Your Website Need?

Most WordPress websites should start with a PHP memory limit of 128 MB to 256 MB. Sites running complex plugins or memory-intensive operations may need 512 MB, but the appropriate value depends more on the workload than the number of pages or visitors.

Website or WorkloadPractical Starting Point
Small PHP website or basic WordPress blog128 MB
Typical WordPress business website256 MB
WooCommerce, membership, or LMS website256–512 MB
Plugin-heavy website or complex page builder256–512 MB
Large imports, backups, or image-processing tasks512 MB or higher

These are planning guidelines. A well-built WooCommerce store may use less memory than a small website running a poor plugin.

Traffic affects PHP memory differently from concurrency. A lightweight site receiving many uncached requests may need more PHP workers, while one large product import may require more memory for a single process. SiteGround, for example, sets WordPress memory to 256 MB by default and allows up to 512 MB on shared accounts through wp-config.php. Cloud plans may support more.

What Happens When the PHP Memory Limit Is Too Low?

A low PHP memory limit causes the active script to fail when it tries to allocate more memory than the server permits. The most direct sign is an error containing text similar to “Allowed memory size exhausted.”

Other symptoms include:

  • A WordPress critical-error message during a plugin or theme operation.
  • A blank page or HTTP 500 error.
  • An incomplete import, export, backup, or malware scan.
  • Failed image resizing or thumbnail generation.
  • A page builder that cannot save a complex layout.

Cached public pages may continue to load while an uncached WordPress administration task fails because the cached page does not repeat the same PHP work.

These symptoms do not prove that memory is responsible. Plugin conflicts, PHP incompatibility, database errors, and CPU exhaustion can produce similar failures. Check the error message and PHP log before changing the limit.

How Can You Check Your PHP Memory Limit?

You can check the limit through your hosting control panel, WordPress Site Health, or a temporary PHP information file. Start with the control panel because it can display the server-level configuration.

Check the Hosting Control Panel

Open the website’s PHP settings and look for memory_limit. The menu may be called PHP Configuration, PHP Options, or PHP Info.

Hostinger customers can find the value through PHP Info in hPanel: Go to Websites → Dashboard → Advanced → PHP Info (see screenshot below). Hostinger states that its Web and Cloud plans have fixed plan-specific maximums. Customers can edit supported parameters through PHP Options within the plan’s permitted range.

Example: Hostinger’s hPanel shows the account’s PHP settings and plan-level memory limit, which helps site owners confirm whether they can raise the PHP memory limit or need a higher hosting plan.

Check WordPress Site Health

Open Tools > Site Health > Info > Server. The value shown may be lower than the hosting account’s maximum.

Use a PHP Information File

Custom PHP websites can display the active configuration with a file containing phpinfo(). Delete it immediately after checking because a public PHP information page exposes server configuration details.

How Can You Increase the PHP Memory Limit?

You should increase the PHP memory limit through the hosting control panel when that option is available. The control panel reduces the risk of editing the wrong file and shows which values the provider permits.

WordPress users can also add these constants to wp-config.php before the line that says, “That’s all, stop editing.”

define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '512M');

WP_MEMORY_LIMIT applies to normal operations. WP_MAX_MEMORY_LIMIT lets WordPress request more for certain administration tasks. Both remain subject to the server limit.

Other environments may accept changes through php.ini, .user.ini, or .htaccess. The correct method depends on the PHP handler and hosting permissions. Contact support when the change does not take effect.

Back up configuration files before editing them. Avoid setting the limit to -1, which removes the PHP ceiling and lets a faulty script consume memory until another server restriction stops it.

Should You Increase the Limit, Optimize the Website, or Upgrade Hosting?

Increase the PHP memory limit when a legitimate operation slightly exceeds the current allowance. Optimize the website or upgrade its hosting when memory errors keep returning during normal use.

SituationAppropriate Response
One legitimate operation slightly exceeds the limitIncrease the limit within the provider’s allowed range
A plugin suddenly consumes excessive memoryTroubleshoot, update, replace, or remove the plugin
A large import fails but the rest of the site worksDivide the import or temporarily increase the limit
Memory errors return during ordinary page or admin requestsAudit plugins, queries, background jobs, and PHP logs
The site also reaches CPU, RAM, I/O, or PHP concurrency limitsUpgrade to a plan with more suitable resources
The host does not permit the memory the application requiresMove the site to a plan or platform with a higher ceiling

A higher limit is not a performance upgrade. A script may complete under a 512 MB ceiling but still run slowly because of weak CPU allocation, inefficient database queries, or external API delays. Repeated exhaustion can also point to a faulty plugin, theme, query, or background process.

What PHP Memory Limit Should You Choose?

Choose 256 MB as a practical baseline for a WordPress business website. Consider 512 MB for WooCommerce, membership, LMS, page-builder, import-heavy, or image-heavy workloads when measurements justify it.

Confirm both the WordPress setting and the hosting provider’s server-level ceiling. Increase the limit for a valid memory-intensive task, but investigate the application when ordinary requests repeatedly exhaust it. Upgrade the hosting plan when the website reaches multiple resource limits rather than PHP memory alone.

You May Also Be Interested In:

About the Author: Jerry Low

Jerry Low has more than 20 years of experience building and hosting websites. He founded HostScore to turn that hands-on experience into practical hosting reviews based on uptime monitoring, speed measurements, latency checks, and load testing.
Photo of author

More from HostScore

Find a Web Host Backed by Real Test Data

HostScore reviews web hosts using TTFB, uptime, load test results, latency, and Core Web Vitals. Our Web Hosting Finder combines these findings with your website type, expected traffic, and budget to recommend suitable options.

See why each host fits your needs, which limitations to check, and what trade-offs to expect.

Try Web Hosting Finder (Free)