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.
In this article, we will discuss:
- How to Modify the php.ini File and Increase PHP Memory
- How to Modify the user.ini File and Increase PHP Memory
- Review
How to Modify the php.ini File and Increase PHP Memory
- Use the FTP program of your choice to connect to your website, then open the folder where the website files are located.
- Locate the php.ini file, then download the file to your computer.
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.
Note: We recommend that you make a second copy of this file before making any edits. - Open the php.ini file. Add the following lines of code to the php.ini file:
- memory_limit = 128M
- output_buffering = 2048
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. - Save the file
Note: Make sure that the file is still named php.ini.
- Upload the php.ini back to the folder where the website files are saved.
- 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.
- 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
- Use the FTP program of your choice to connect to your website, then open the folder where the website files are saved.
- Locate the user.ini file, then download the file to your computer.
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.
Note: We highly recommend that you make a second copy of this file before making any edits. - Open the user.ini file. Add the following lines of code to the user.ini file:
-
- memory_limit = 128M
- output_buffering = 2048
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. -
- Save the file.
Note: Make sure that the file is still named user.ini.
- Upload the user.ini back to the folder where the website files are saved.
- 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.
- 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.