Knowledgebase

How to set the upload_max_filesize & post_max_size to 64M by default in PHP Selector?

To set upload_max_filesize and post_max_size to 64M by default using PHP Selector in a CloudLinux environment, follow these steps:

  1. Access PHP Selector: Log in to your server's control panel (cPanel, Plesk, etc.) and navigate to the PHP Selector or Alt-PHP Manager section.

  2. Select PHP Version: Choose the PHP version you want to modify the options for. This can usually be done via a drop-down menu or similar interface in the PHP Selector.

  3. Access PHP Options: Look for an option like "PHP Options", "Select PHP Options", or similar wording. Click on it to access the configuration panel for the selected PHP version.

  4. Locate upload_max_filesize and post_max_size: In the PHP Options panel, look for upload_max_filesize and post_max_size. These options control the maximum file size that can be uploaded and the maximum size of POST data that PHP will accept, respectively.

  5. Change the Values: Find the fields for upload_max_filesize and post_max_size and set them to 64M.

  6. Save Changes: Once you've made the necessary adjustments, look for a "Save" or "Apply" button and click it to save your changes.

  7. Verify Changes: It's a good practice to verify that the changes have taken effect. You can do this by creating a PHP file with the following content:

    php

 

  • <?php phpinfo(); ?>

    Access this file through a web browser. It will display detailed information about your PHP configuration. Look for the values of upload_max_filesize and post_max_size to ensure they are set to 64M.

  • Restart Web Server (if necessary): Depending on the changes you've made, you may need to restart your web server for the new PHP settings to take effect. This is especially important for changes related to file uploads.

    Use one of the following commands based on your web server:

    For Apache:

    bash

 

sudo systemctl restart httpd

For Nginx with PHP-FPM:

bash
  1. sudo systemctl restart php-fpm sudo systemctl restart nginx

Remember that the exact steps and terminology may vary depending on your specific hosting panel and server configuration. If you're unsure about any of the steps, consult the documentation provided by your hosting provider or CloudLinux for specific instructions. Always make sure to back up any critical data and configurations before making significant changes to your server's PHP settings.

  • 0 Users Found This Useful
Was this answer helpful?