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.