How to Change Variables such as Max Upload Size, Memory Limit etc in WordPress?

Change Variables in WordPress

If you have been running a self-hosted WordPress Blog or Website for a while, you have to install multiple plugins after several times, after installing a new theme, after increasing traffic or after any other change, Maybe there are such errors or notices.

  • PHP Memory Limit Exhausted
  • PHP Maximum Execution Timeout Error
  • Limited Upload File Size
  • Uploads Disabled
  • Maximum No. of Files Upload Limited
Memory Limit Error
Memory Limit Error

So there are many more PHP based variables which, at times, cause you problems due to limited values. Let me explain you through an example.

Suppose, you have created your WordPress website on a web hosting, which has a RAM limit actually 1 GB or 1024 MB, but in your server’s php.ini file, this limit is overridden, and there is value 512 of memory_limit PHP variable Due to MB set, you are not able to take full advantage of 1024 MB. In this case, you can use only 50% of your actual available RAM at a time.

php.ini file is a file created in the root directory of your server which governs the server by using these PHP variables. Now if you have to use the full resources of your server, and run your WordPress website in a great way, then by going to your server’s file manager, or by connecting to the server via FTP, then go to the php.ini file Have to edit. This work goes to a little advanced scale, because at times, the php.ini file is not directly visible to you and due to version changes, you can not implement it correctly.

So in such a way, today I have come up with a very easy and excellent user interface to manage these variables for you.

PHP Settings is a very simple plugin, which will help you in this work. Install and activate this plugin in your WordPress Blog.

PHP Settings

Once you have installed and activated this plugin, after that, you have to go to Tools > PHP Settings in the WordPress Dashboard , as shown in the screenshot below:

PHP Settings

After this, your salmon will open its interface. The interface below has been explained in the screenshot below. If no variables are set in php.ini, then Editor window will be blank.

PHP Settings

After this, you have to go to the settings tab. This tab will list all the PHP variables or directives, which you can edit. The directives, which will already be overridden in your server’s php.ini files, will also be mentioned in the label, as mentioned below, as 3 directives have been labeled in the screenshot below. The list of these directives is quite long, so you can easily use that search bar as above to easily cover that directive, whose value you have to set.

PHP Settings

 

In the corresponding checkboxes of the variables you want to set, you have to tick and then click on the Copy to Editor button above.

Note: I have noticed that this option to Copy to Editor works on many occasions that you have to check the variables you have to set up first, and then by unchecking it, click on the Copy To Editor button. So you try to understand this process as yourself.

When you have finished the step above, then come back to the editor window and then whatever value you would like to set a directive. As you can see in the screenshot below, I have set the value of 3 variables.

  • memory_limit = 3072M (to limit RAM to 3 GB or 3072 MB to {1 GB = 1024 MB} )
  • post_max_size = 80M (maximum size of a single post to 80 MB)
  • upload_max_filesize = 256M (maximum size to 256 MB to upload a single file)

PHP Settings

Do not forget to save the settings by clicking the Save Settings button!

To get more such informational posts and to receive Notifications about new blog posts, please subscribe us. Please comment below to ask any questions related to this blog post.

Tell me if any questions related to this post are in your mind?

In order to show your happiness and excitement towards our post, please share this post on Social Networks such as Facebook, Google+ and Twitter.

ZulWeb

Written by ZulWeb

Learn tech blogging with ZulWeb. ZulWeb covers tech, IoT, blockchain, social media, web, blogging, tutorials, lifestyle, money, travel, health, and fitness.

WhoisGuard

What is WhoisGuard? – Protect your Domain’s Private Information

Ping List for Fast Indexing of WordPress Posts

Ping List for Fast Indexing of WordPress Posts