Chris
Chris

Reputation: 889

PHP upload file limit

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

Upvotes: 1

Views: 1723

Answers (2)

Ja͢ck
Ja͢ck

Reputation: 173522

First, check phpinfo() to see what the runtime settings are; if they still show 2M (default), Apache is probably not obeying the .htaccess file

Normally I would tell you to make sure you have this in the virtual host declaration of your Apache configuration:

AllowOverride Options FileInfo

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_value settings inside your virtual host

Alternatively, work around the issue by chunking the upload files (e.g. upload 1MB at a time) as suggested by @Satya.

Upvotes: 2

Satya
Satya

Reputation: 8881

if you can not make changes to php.ini then I am afraid you will have to try any jquery based uploaders e.g. valum or blueimp

Upvotes: 0

Related Questions