Loading...

Knowledge Base

How to Increase WordPress PHP Memory

Running into a memory limit error on your WordPress site will do nothing but make you wonder, especially at a time when such things break up your workflow. Mastering How to Increase WordPress PHP Memory will certainly keep you from experiencing this problem.

If you are experiencing an error inside your WordPress Administrator panel that reads, "Fatal error: Allowed memory size of 33554432 bytes exhausted…”, or if you see the white screen of death, you may need to increase your memory allocation for PHP. For more information about the white screen, please check How Do I Troubleshoot the WordPress White Screen of Death?

Please follow these steps to increase your memory by modifying your php.ini file for Unix-based hosting packages and user.ini for Windows-based hosting packages.

To complete these steps, you must connect to your website with an FTP program.

Note: We will use Filezilla for demonstration purposes only. You can use your preferred FTP Client if needed. If you need a comprehensive guidea about FTP, visit FTP FAQs and Troubleshooting: A Comprehensive Guide.

In this article, we will discuss:

How to Modify the php.ini File and Increase PHP Memory

  1. Use the FTP program of your choice to connect to your website, then open the folder where the website files are located.
  2. Locate the php.ini file, then download the file to your computer.
    Filezilla download phpini file

    If the file does not exist, you can use any notepad program to create a new file. Name the new file php.ini. Ensure .ini is the file extension of the file.
    php.ini file
     
    Note: We recommend that you make a second copy of this file before making any edits.
  3. Open the php.ini file. Add the following lines of code to the php.ini file:
    • memory_limit = 128M
    • output_buffering = 2048
      phpini notepad code
    Note: The php.ini file can be opened in any editor of your choice. If you do not have an editor, you can use another program, such as Notepad.
  4. Save the file
    Note: Make sure that the file is still named php.ini.
  5. Upload the php.ini back to the folder where the website files are saved.
    Filezilla Upload phpini
     
  6. Suppose there is a file inside the website folder named php.ini.coalesced , delete it. You can right click on the file for the delete option to appear.
  7. Browse to any PHP-enabled website, such as your WordPress Administrator panel. This will enable your settings.

You have updated the php.ini file and increased the PHP memory.

How to Modify the user.ini File and Increase PHP Memory

  1. Use the FTP program of your choice to connect to your website, then open the folder where the website files are saved.
  2. Locate the user.ini file, then download the file to your computer.
    Filezilla download userini file

    If the file does not exist, you can use any notepad program to create a new file. Name the new file user.ini. Ensure .ini is the file extension of the file.
    userini file
     
    Note: We highly recommend that you make a second copy of this file before making any edits.
  3. Open the user.ini file. Add the following lines of code to the user.ini file:
      • memory_limit = 128M
      • output_buffering = 2048
        userini notepad code
    Note: The user.ini file can be opened in any editor of your choice. If you do not have an editor, you can use another program, such as Notepad.
  4. Save the file.
    Note: Make sure that the file is still named user.ini.
  5. Upload the user.ini back to the folder where the website files are saved.
    Filezilla Upload userini file
     
  6. Suppose there is a file inside the website folder named user.ini.coalesced, delete it. You can right click on the file for the delete option to appear.
  7. Browse to any PHP-enabled website, such as your WordPress Administrator panel. This will enable your settings.

You have updated the user.ini file and increased the PHP memory.

Review

Increasing the PHP memory limit in WordPress will help solve errors such as the "white screen of death" and improve the performance of your site. You will have to edit either the php.ini file or the user.ini on your shared hosting plan. You will need to hook into your server using an FTP program to download, edit, and upload back the respective files with the desired changes in memory limit.

Did you find this article helpful?

 
* Your feedback is too short

Loading...