Get 30% off your WordPress Hosting with code WPSAVE10. Launch Faster. Save More!
  • 00 Days
  • 00 Hours
  • 00 Minutes
  • 00 Seconds

What is the PHP memory_limit? - SIRSTEVEHQ CP

The PHP memory_limit is the maximum amount of server memory that each PHP script can use. 

The official PHP documentation explains this in greater detail. 

“This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts from eating up all available memory on a server.”  

PHP memory usage is typically managed by the PHP interpreter and the web server running PHP scripts. PHP has a default memory limit setting, which restricts the amount of memory a script can use.  

The default value for PHP memory is 128M. This can be raised if an application or website needs more memory. 

It's important to note that allocating too much memory to PHP can also have negative consequences, such as slowing down the application or causing other performance issues. This may be due to a specific PHP process using far too much memory than what is available. 

When a script exceeds the memory limit that's been set for the server an error similiar to the following will be logged.

Fatal error: Allowed memory size of x bytes exhausted (tried to allocate x bytes) in /example/php/script PHP Fatal error: Out of memory (allocated x) (tried to allocate x bytes) in /example/php/script

You can update the PHP memory limit for your site through SIRSTEVEHQ CP.

Be aware that if you're on a SIRSTEVEHQ Cloud then your server has a physical memory limit. You should optimize your code if the memory_limit parameter is already set to its maximum.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I install NodeJS on my SIRSTEVEHQ Cloud?

NodeJS is a server-side Javascript runtime environment which aims to assist in the building of...

How do I deploy a .NET Core application on a SIRSTEVEHQ Cloud?

Deploying a .NET Core application through the Application Manager is quick and easy. Before you...

How do I get started on SIRSTEVEHQ Cloud?

Unlike an unmanaged virtual private server (VPS) setup, our SIRSTEVEHQ Cloud platform is...

How many websites can I host on SIRSTEVEHQ Cloud?

With any SIRSTEVEHQ Cloud package, you can host as many websites as you like. You're in control...

Do I get email with SIRSTEVEHQ Cloud?

Yes. With SIRSTEVEHQ Cloud you can take full advantage of our high-end clustered email platform....