ninacoder-info / music-engine-web-wiki

11 stars 6 forks source link

post_max_size is too low Cloudways #21

Open mixedbytsk opened 2 years ago

mixedbytsk commented 2 years ago

im having post_max_size is too low and upload_max_filesize is too low issues on cloudways host

All my settings are setup correctly

BWingMedia commented 2 years ago

You may want to change the maximum upload file size for your web site. For example, you can set a lower limit to prevent users from uploading large files to your site. To do this, change the upload_max_filesize and post_max_size directives in an .htaccess file. To change the maximum upload file size for your PHP scripts, follow these steps:

  1. Log in to your account using SSH.
  2. Use a text editor to add the following line to the .htaccess file. Replace xx with the maximum upload file size that you want to set, in megabytes: php_value upload_max_filesize xxM
  3. Add the following line to the .htaccess file. Replace xx with the maximum HTTP POST file size that you want to set, in megabytes:

php_value post_max_size xxM

To ensure that file uploads work correctly, the post_max_size directive should be a little larger than the upload_max_filesize. For example, to set a file upload limit of 20 megabytes, you could set the upload_max_filesize directive to 20M, and the post_max_size directive to 21M.
  4. Save the changes to the .htaccess file and exit the text editor.
  5. To verify that the new setting is active, create a PHP test file that contains the following code in the same directory where the .htaccess file is located:<?php phpinfo(); ?>
  6. Load the test file in your web browser, and then search for the name of the directive. The Local Value column should display the new setting that you specified in the .htaccess file.