This article describes how to resolve a problem that may occur when you run a PHP-based web application, such as WordPress or Drupal.
When you try to view a PHP-enabled page, you receive an error message that resembles the following (the exact values and paths vary):
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 33554432 bytes) in /home/example/public_html/filename.php on line 1622
This problem occurs when an application uses more memory than PHP allows.
If you develop a site using your own PHP code, you can try to make your code more memory-efficient. For example, you can use the unset() function to destroy variables and objects that you no longer need, thereby freeing up memory.
However, if you are running a third-party web application, such as WordPress or Joomla, it is highly inadvisable to modify the code directly. In such scenarios, you may need to increase the PHP script memory limit. The method to do this depends on the type of hosting account you have.
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.