I just bought a year of web hosting and I paid for the 50GB plan. I want to allow small attachments up to 260MB each on my website. I used this:

php_value upload_max_filesize
php_value post_max_size
php_value memory_limit

Found here https://www.cyberciti.biz/faq/linux-unix-apache-increase-php-upload-limit/ to change the settings to the appropriate MB but it immediately caused a 500 Internal Server Error when I went to my website. Obviously all I have to do to make my website work again is delete this file (thank goodness!!) but how can I modify this code to make it change the max upload setting on my website? I tried creating and editing my own php.ini but that didn't work either.

  • Presumably you did state a value, eg. php_value upload_max_filesize 5M? (Otherwise you will get a 500 error)
    – MrWhite
    Feb 12, 2017 at 0:19
  • Yes, I stated a value for all 3. And now my website is completely offline - deleting the file didn't fix it like I thought it would...
    – lordcashew
    Feb 12, 2017 at 0:22
  • You must have made other changes if deleting the file does not fix it. Or you are seeing a cached response? How is PHP installed? PHP would need to be installed as an Apache module for the .htaccess method to work. Otherwise, you can try .user.ini in PHP 5.3+ (under CGI/FastCGI) eg. upload_max_filesize = 5M. Your host might have also disabled this ability - try changing the options in cPanel instead? Your host should be able to tell you how these options can be modified.
    – MrWhite
    Feb 12, 2017 at 0:40
  • I changed PHP version from 5-something to 7-something right before creating and editing the .htaccess due to another guide but I checked my site and it was fine. Augh... Thank God I made a backup right before. I also emailed my horrifically terrible web host.
    – lordcashew
    Feb 12, 2017 at 1:25

1 Answer 1


Some web hosting providers, especially on shared servers, don't allow for an increased upload file size limit or increased memory limit.

Depending on the way your web hosting provider has configured their servers the way to do this will vary and so the best option here is to get in contact with your hosting provider to ask them how to do this on their servers. If you are allowed to then they will be able to tell you how to do this and if it is not allowed for shared servers then they will be able to provide this information as well in which case your only option would be to either change to a shared hosting provider that does allow increasing the upload file size limit or changing to a VPS service where you have greater control over the server than on a shared hosting provider.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.