Site icon mulcas

How To Adjust php.ini Values in WordPress

How To Adjust php.ini Values in WordPress

Depending on the theme and configuration required, you’d need to know how to Adjust php.ini Values in WordPress. The most common values to configure are PHP Time Limit and PHP Max Input.

Background

WordPress is the most popular and most handy CMS when designing websites. However, some of its most simple settings can be bothersome and seen as a burden if you are not too familiar with web development.  

One of the remarkable aspects of WordPress is the variety of powerful plugins and themes you can install. Yet, this is also seen as a downside, as maintenance and configurations could become daily tasks.

Depending on the theme used, one of the first things you might need to adjust is some parameters/values from the WordPress php.ini configuration. More often than not, (premium) themes come with a Dashboard or System Status section where you can see the recommended values to utilize.

PHP Time Limit and PHP Max Input

One of the most common values to adjust are:

There are others, such as upload_max_filesize and post_max_size, to control the maximum file size (images) that you can upload to your posts.   

The below image is an example of how your theme will display the system status. Again, this will vary depending on your theme.

How To Adjust php.ini Values in WordPress

There are some ways to adjust PHP.ini values. You can do it directly in the php.ini file, wp-config.php file, or even the .htaccess file. However, my preferred and safest way is to create an additional file to add or modify these values. So you don't have to touch the critical files.

The host you are using will also dictate how to access these files. For the sake of simplicity, I'll assume you are using a Cpanel.

From Cpanel, go to File > File Manager.

Located in your domain, go to the public_html folder. 

Note: If you have subdomains and use shared hosting like HostGator, you need to go to your subdomain folder. Ex: main_domain.com/sub_domain.com

Here, please create a new file, name it .user.ini, and then edit the file and input the values recommended by your theme.

For example, I am using:

max_input_vars = 5000
max_execution_time = 300
post_max_size = 50M
upload_max_filesize = 50M

After you save the file and refresh your theme dashboard or status page, you'll get something similar to the image below.

Resources

wordpress.com

Exit mobile version