I am uploading profile images to a directory on the server. The script works fine, however I can’t seem to get anything but small file size images to upload. Anything above about 2mb fails. I don’t have access to the php.ini but I have added the following to htaccess with no luck. I have tried every other solution I can find online with no luck. Any ideas?
php_value upload_max_filesize 10M
php_value post_max_size 10M
php_value max_input_time 400
php_value max_execution_time 400
First, check
phpinfo()to see what the runtime settings are; if they still show2M(default), Apache is probably not obeying the .htaccess fileNormally I would tell you to make sure you have this in the virtual host declaration of your Apache configuration:
But being on a shared host doesn’t give you those permissions (highly unlikely). You should check with your hosting provider to see whether they can raise those limits for you by adding the
php_valuesettings inside your virtual hostAlternatively, work around the issue by chunking the upload files (e.g. upload 1MB at a time) as suggested by @Satya.