A Quick Guide to PHP INI Settings

6 min read

Information

This is a supplementary article to our Configure PHP guide.

Introduction

PHP INI settings are configuration directives that control how PHP executes scripts, manages resources, handles errors, and processes requests on the server. These settings impact performance, security, and functionality for your WordPress websites, and while our default settings are fine for 99% of websites, this article covers when you may need to make adjustments to these settings.

Unlike many hosts, GridPane allows you to configure these settings on a per-site basis. In this article, we’ll cover how these settings apply to WordPress websites as individual applications.

Changing Your PHP INI Settings

To update your PHP INI settings, we highly recommend that you use the new tab inside your GridPane account dashboard.

You can open up your site customizer by clicking the site’s domain name inside the Sites page of your GridPane account.

PHP settings are inside the PHP tab. Before you can make changes, you may need to sync your settings. You can do this by clicking the Sync PHP Settings button:

1. Max Execution Time (seconds) 

GridPane default: 300 seconds (5 minutes)

This setting controls how long a PHP script can run before it’s stopped. WordPress uses PHP scripts for tasks like importing content, running updates, and processing large operations.

Need to know:

  • If too low: Large data imports (like WooCommerce product imports) may fail, backup plugins may time out, page builders may experience errors when saving large pages, etc. 
  • Recommended for WordPress: 300 seconds (5 minutes) is usually enough for most websites.

Performance Implications

A high Max Execution Time can result in long-executing PHP scripts hogging CPU and resources, potentially leading to an equivalent of a Denial of Service (DoS) attack. In some cases, an attacker might even be able to exploit long-running scripts to shut down your website effectively.

Examples:

  • Slow POST/GET Requests such as running complex database queries repeatedly, or expensive tasks like plugin backups, etc.
  • Multiple Concurrent Requests – If a plugin or service, or even an attacker, floods your server with multiple PHP processes that run for 300 seconds each, it will hog your CPU and RAM, making your site (potentially ALL sites on your server) slow or unresponsive.

Protecting Against Performance Issues:

  • Limit the Number of PHP Workers: Properly configuring PHP workers prevents excess RAM consumption and limits access to the CPU. 
  • Use a WAF (Web Application Firewall) and activate WP Fail2Ban to minimize malicious traffic by detecting and blocking malicious requests.
  • Set a Reasonable Execution Time: 300 seconds is fine for most WordPress sites, but you can reduce it to 60–120 seconds if your site doesn’t run long processes.

2. Max File Uploads

GridPane default: 20

This setting limits the number of files that can be uploaded in a single request. If you upload multiple images, PDFs, or media files at once, this setting controls how many can be processed at the same time.

This setting also affects WooCommerce product imports and some form plugins that allow multiple file uploads.

Need to know:

  • If too low: Bulk media uploads or plugin features that rely on multiple files may fail.
  • Recommended for WordPress: 20 is generally fine, but some media-heavy sites may increase this.

3. Max Input Time (seconds)

GridPane default: 60 seconds

This setting defines how long a script can take to receive input (such as form submissions, file uploads, and saved posts/pages) before timing out.

Need to know:

  • If too low: Large file uploads or complex form submissions might fail.
  • Recommended for WordPress: 60 seconds is usually sufficient.

4. Max Input Vars

GridPane default: 5000

This setting limits the number of input variables (GET/POST requests). WordPress themes and plugins, especially ones with complex settings, can generate a lot of input fields.

Need to know:

  • If too low: Saving theme settings or long menu structures might fail.
  • Recommended for WordPress: At least 5000, but increase if saving settings are not working. Higher settings can result in more RAM usage.

5. Memory Limit (MB)

GridPane default: 256 MB

This setting defines the amount of memory PHP scripts can use. More memory is needed to run large plugins, handle many users, and process heavy scripts.

Need to know:

  • If too low: Memory errors may appear, especially with WooCommerce, Elementor, or large databases.
  • Recommended for WordPress: 256MB is a good balance for most sites, but e-commerce or large websites may need 512MB+.

6. Post Max Size (MB)

GridPane default: 512MB

This sets the maximum size of a POST request. This affects file uploads and form submissions.

Need to know:

  • If smaller than Upload Max Filesize: File uploads might fail, even if allowed by the Upload Max Filesize setting.
  • Recommended for WordPress: It should be the same or slightly larger than upload_max_filesize.

7. Default Socket Timeout (seconds)

GridPane default: 60 seconds

This setting defines how long PHP waits for data when communicating with external sources (APIs, external websites, payment gateways, etc).

Need to know:

  • If too low: Some API calls (like WooCommerce payment gateways or automatic updates) might fail.
  • Recommended for WordPress: 60 seconds is usually fine.
  • When to increase: Increase if APIs time out frequently.

9. Session GC Maxlifetime (seconds)

GridPane default: 1440 (24 minutes)

This setting determines how long PHP keeps session data before it is deleted (garbage collected). Sessions store temporary data, such as user login states, shopping cart contents, and form entries.

WordPress does not rely heavily on PHP sessions, as it primarily uses cookies for user authentication. However, some plugins – particularly those related to e-commerce, memberships, and user management – may use PHP sessions.

Need to know:

  • If too low: User sessions (like login states) might expire too quickly.
  • Recommended for WordPress: 1440 seconds (24 minutes) is good, but WooCommerce sites may need a longer duration.

10. Short Open Tag (On/Off)

GridPane default: Off

Turning this setting ON allows the use of (<? instead of <?php) in PHP files.

Need to know:

  • Not recommended for WordPress: Short tags were deprecated in PHP 7.4 and removed in PHP 8.0. Since WordPress follows best practices, this should be OFF unless needed.

Why would your site need this Setting turned ON?

A WordPress site would only require PHP short open tags to be ON if the site breaks with it off. Here are the most common reasons:

  • Old or Poorly Coded Plugins/Themes: Some older or poorly developed themes or plugins might contain PHP files using short tags (<? echo "Hello"; ?>) instead of the full <?php echo "Hello"; ?>. If short open tags are off, these scripts will break.
  • Custom Legacy Code: If a developer wrote custom code for the WordPress site using short tags (especially if migrated from an older PHP version where short tags were more common), enabling it would prevent syntax errors.
  • Older web hosts: Some older hosting environments had short tags enabled by default.

11. Upload Max Filesize (MB) 

GridPane default: 512MB

This setting controls the maximum file size you can upload via the WordPress media library.

Need to know:

  • If too low: Large images, videos, or theme/plugin uploads may fail.
  • Recommended for WordPress: At least 64MB, but media-heavy sites might need 128MB+.

Further Reading

To learn more about server-level PHP settings, PHP workers, and how to configure your PHP settings, please check out these articles:

  1. Configure PHP
  2. PHP Workers and WordPress: A Guide for Better Performance