PHP Memory Limit is the maximum amount of memory that a PHP script can use on a server. If a PHP script exceeds the memory limit, it will cause an error and stop running. This limit can affect the functionality and performance of PHP applications, and can be set by either the server administrator or the web application developer.
How to increase the memory limit in PHP WebApp Settings
If your PHP script exceeds the memory limit, it will cause an error and stop running. To prevent this, you can increase the memory limit for your PHP web applications in the RunCloud dashboard.
To increase the memory limit, follow these steps:
- Log in to your RunCloud account and go to the Web Application page.
- Select the web application for which you want to increase the memory limit.
- On the web application dashboard, choose ‘Settings‘ from the side menu.
- Scroll down to the ‘PHP Settings‘ section and find the ‘MEMORY_LIMIT‘ option. This is the memory limit for your web application in megabytes (MB).
- Change the value of the MEMORY_LIMIT option to the desired amount. We recommend 256 MB, but your settings can be as much as your server will allow.
- Click on the ‘Update PHP Settings‘ button to apply the changes.
How to increase the memory limit in the WordPress wp-config.php file
If you are using WordPress, you can also increase the memory limit in the wp-config.php file. This is a configuration file that contains various settings for your WordPress site. The memory limit in the wp-config.php file can override the memory limit in the PHP WebApp Settings.
To increase the memory limit in the WordPress wp-config.php file, follow these steps:
- Log in to your RunCloud account and go to the File Manager page of your web application.
- Find the wp-config.php file and click on it to open a text editor.
- In the editor, find the line that says
define( 'WP_MEMORY_LIMIT', '64M' );
. This is the memory limit for your WordPress site in megabytes (MB). - Change the value of the WP_MEMORY_LIMIT constant to the desired amount. For example, if you want to increase the memory limit to 256 MB, you can change the line to
define( 'WP_MEMORY_LIMIT', '256M' );
. - Click on the Save button to save the changes. You may need to refresh your WordPress site for the changes to take effect.
To learn more about memory limits in WordPress, read our in-depth article on the wp-config.php file.
Note: If you are using WordPress, you should make sure that the memory limit in the wp-config.php file and the memory limit in the PHP WebApp Settings are the same. This will ensure that your WordPress site can use the maximum amount of memory available on your server.
If the memory limit in the wp-config.php file is lower than the memory limit in the PHP WebApp Settings, your WordPress site will use the lower value. If the memory limit in the wp-config.php file is higher than the memory limit in the PHP WebApp Settings, your WordPress site may encounter errors or performance issues.