Increasing the upload max filesize and other PHP settings can be essential for ensuring that your website can handle larger files, especially for applications like WordPress, Joomla, or any file upload forms. Here’s a step-by-step guide on how to modify these settings in cPanel.

What You’ll Learn:

  1. Accessing the MultiPHP INI Editor.
  2. Modifying the upload limits and other PHP settings.
  3. Verifying changes.

1. Log in to cPanel

Start by logging into your cPanel account:

  • Go to your cPanel login URL (usually yourdomain.com/cpanel).
  • Enter your username and password.

2. Access the MultiPHP INI Editor

  1. In the cPanel dashboard, look for the Software section.
  2. Click on MultiPHP INI Editor.

3. Select Your Domain

  1. In the MultiPHP INI Editor, select the domain for which you want to increase the upload size from the dropdown menu.

4. Modify PHP Settings

In the editor, you will see various PHP directives you can modify. The key settings for increasing the upload filesize are:

  • upload_max_filesize Maximum size of an uploaded file.
  • post_max_size: Maximum size of POST data that PHP will accept (should be larger than upload_max_filesize).
  • memory_limit: Maximum amount of memory a script may consume.
  • max_execution_time: Maximum time in seconds a script is allowed to run before it is terminated.

Example Settings:

ini

Copy code

upload_max_filesize = 64M

post_max_size = 64M

memory_limit = 128M

max_execution_time = 300

 

  1. Enter the desired values in the corresponding fields. Make sure to set post_max_size larger than upload_max_filesize.

5. Save Changes

  1. After making your changes, scroll down and click Apply to save the settings.

6. Verify Changes

To confirm that your settings have been updated:

  1. Create a PHP Info File:
    • In the File Manager, navigate to your website’s root directory (usually /public_html).
    • Create a new file named phpinfo.php.

Add the following code to the file:
php
Copy code
<?php

phpinfo();

?>

  • Save the file.
  1. Open the PHP Info Page:
    • In your web browser, go to yourdomain.com/phpinfo.php.
    • Search for upload_max_filesize, post_max_size, and memory_limit to confirm the values have been updated.

7. Best Practices

  • Backup Configuration: Before making changes, consider backing up your current PHP configuration.
  • Test Your Application: After making adjustments, test file uploads to ensure everything is functioning correctly.
  • Remove phpinfo.php: Once you’ve verified your settings, delete the phpinfo.php file for security reasons.

Conclusion

Increasing the upload max filesize and other PHP values in cPanel is a straightforward process that can significantly improve the functionality of your website. By following these steps, you can easily adjust the necessary settings to accommodate larger file uploads and ensure that your applications run smoothly.

هل كانت المقالة مفيدة ؟ 0 أعضاء وجدوا هذه المقالة مفيدة (0 التصويتات)