Increase Maximum Upload and PHP Memory Limits

Table of Contents

In the realm of web development, optimising upload capacities and PHP memory limits is a crucial facet often overlooked. Discovering methods to enhance these limits not only ensures smoother functionality but also elevates the performance of your website or application. In this article, we delve into effective strategies to amplify maximum upload capabilities and PHP memory limits, empowering you to streamline operations and elevate user experiences effortlessly.

 

This comprehensive guide navigates the varied methods available in cPanel & WHM to set PHP values, offering detailed insights into each approach. Gain a clear understanding of when and how to utilise these interfaces effectively for optimal configuration.

 

Procedure To Increase Maximum Upload and PHP Memory Limits

 

For cPanel Users

 

When troubleshooting issues within your specific cPanel site, utilizing the ‘MultiPHP INI Editor’ offers a focused solution. Its ‘Basic Mode’ conveniently modifies prevalent PHP settings, while the ‘Editor Mode’ grants comprehensive control, enabling direct edits to the php.ini file for a wider range of configuration options.

 

  1. Log in to cPanel.
  2. Navigate to “cPanel / Software / MultiPHP INI Editor.”
  3. In “Basic Mode,” choose your domain from the dropdown menu to load and view your current settings.
  4. Make any adjustments, such as to “memory_limit,” then click “Apply” at the bottom of the page.
  5. If an option is not available in “Basic Mode,” the “Editor Mode” can be used to make advanced configuration changes to your sites.
    • If the “Editor Mode” is blank, click “Apply” from the “Basic Mode” screen first to create the php.ini file in your document root.

 

For WHM Users

 

When implementing alterations to the overall PHP settings across the system or seeking to deactivate specific functionalities like PHP’s exec() function, WHM’s ‘MultiPHP INI Editor’ becomes the preferred tool over cPanel. It provides the necessary control and scope for system-wide adjustments and feature disabling.

 

  1. Login to WHM.
  2. Navigate to “WHM / Software / MultiPHP INI Editor.”
  3. In “Basic Mode,” choose your desired PHP version from the dropdown menu to load and view your current settings.
  4. Make any adjustments, such as to “memory_limit,” then click “Apply” at the bottom of the page.
  5. If an option is not available in “Basic Mode,” the “Editor Mode” can be used to make advanced configuration changes to each PHP version.

 

Via the Command-Line

 

Every PHP version installed possesses its dedicated php.ini file. Administrators or SSH users have the capability to manually adjust these files. Each PHP version resides within “/opt/cpanel/” in distinct directories labeled as “ea-phpXX.

 

  • /opt/cpanel/ea-phpXX/root/etc/php.ini

For example, PHP 8.1 uses the following path:

  • /opt/cpanel/ea-php81/root/etc/php.ini

If PHP-FPM is in use, restart it after making any changes to these files:

  • /scripts/restartsrv_apache_php_fpm

 

In the realm of managing PHP configurations within cPanel and WHM, having a nuanced understanding of the available tools and directories is key. Whether tweaking individual site settings through cPanel’s ‘MultiPHP INI Editor’ or making system-wide adjustments via WHM, the flexibility offered ensures precise control over PHP functionalities. By navigating these interfaces and directories, users can efficiently tailor PHP settings to suit specific needs, enhancing the performance and functionality of their web environments.