Can't upload large images on server - php

I'm using GD to resize/upload images.
On my local machine it works fine. Now on my server only small images can be uploaded, anything over 500kb returns a server error 500.
I don't know where to start, I was hoping someone could point me in the right direction as to where to start looking for a solution.

check your php.ini for upload_max_filesize, this should work.

Have you tried looking in your server's php.ini file? If you have access to it then you can change the accepted upload file size.
Example:
; Maximum allowed size for uploaded files.
upload_max_filesize = 700M

Check your php.ini file, specifically the settings for post_max_size and upload_max_filesize and set them to the largest size you want the server to accept.

Related

Server issue with large file upload?

I have a dedicated server Linux WHM/Cpanel that hosts a video streaming website. I have a form to upload videos and I've been trying to upload larger files but failing? I've checked error logs and nothing is leading me in the right direction. Below are my php.ini settings
upload_max_filesize = 1200M
post_max_size = 1200M
max_input_vars = 1000
memory_limit = -1
max_file_uploads = 20
max_execution_time = 7200
max_input_time = 7200
max_input_vars = 1000
I can upload a 100MB file just fine but the movies i have can be up to 1gb. I'm using Plupload to upload files. I've tested several small size files and they upload fine. When I try to upload large movies e.g. 300mb, Plupload returns this error HTTP Error. Upload URL might be wrong or doesn't exist. and this is the only clue I have. Plupload uses chunking to split up large files also.
This only happens with larger files. It's really a nuisance also, since I have to upload large files all over again to see if my changes are successful or not.
Any ideas? Why would it work with a smaller size file but not larger? I have no errors to work from.
HTTP Error is common when there is something wrong with the files being uploaded. Please check your server info with php.ini
upload_max_filesize is the limit of any single file.
post_max_size is the limit of the entire body of the request,
Sometimes the server requires post_max_size greater than upload_max_filesize I might be wrong but I have to check.
Try debugging the issue removing the chunking first and then later add the chunking part when you remove those HTTP errors.

move_uploaded_file not working for 2mb and more

I wanted to upload files greater than 2MB and I have changed php.ini as follows :
upload_max_filesize=20M
post_max_size=30M
Restarting Apache updates phpinfo() but files greater than 2MB are not yet being uploaded. What could be the reason?
Check that you updated the right php.ini, some servers accept having a php.ini for a certain folder
A similar question: Photo upload not uploading files bigger than 2MB
Basically you have to modify your php server's configuration as the link shows to you

un-explainable problem with file uploads

Everything was fine with my file upload script until I decided to upload larger files and by larger files am talking about just 2mb talk more of a 30mb file. I have been to my php.ini to change the following:
post_max_size = 100M
upload_max_filesize = 120M
The memory limit was left # d default 128M
after all this settings it still did not work, it shows this error message
"file could not be written to disk"
Some friends suggested that it had something to do with d permissions but I doubt that because the same script works for smaller files 600kb and below. I can't really explain what is going on. Any help would be appreciated.
If linux, check your quota for the user.
Maybe your disk is full.
I had this problem and fixed it by increasing the size of the tmp folder. Check the tmp folder size and make the size is big enough.

What is the maximum file upload size in PHP 5?

Whta is the maximum file upload size in PHP 5? I am uploading a file of 6MB and get error 1. Thanks.
It's determined by upload_max_filesize in your php.ini.
check your php.ini:upload_max_filesize
That might help you :-)
The default is 2 MB, but you can change the upload_max_filesize in the php.ini
The above missed one setting: post_max_size in php.ini .From php doc:
"To upload large files, this value [*post_max_size*] must be larger than upload_max_filesize.
If memory limit is enabled by your configure script, *memory_limit* also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size. "
If you need to see what it is set to on your specific server, create a new file with this:
<?php echo phpinfo();
Then access it using your browser.

image upload in PHP

I can upload small size files with no problem,
but fail when the size is more than 1M.
What's the matter?
You probably need to configure the upload_max_filesize directive, in your php.ini file : PHP will not accept an upload of a file that is bigger than what this directive defines.
And note that you might also need to adjust post_max_size -- which defines the total size of data that can be POSTed (And files upload are sent via POST).
You can also take a look at the Handling file uploads section of the manual, which can give you a couple of useful informations about files upload.
Are you sure you have upload_max_filesize set correctly in php.ini?
Edit you php.ini file to allow for larger uploads.
HERE's some info
You can call echo phpinfo() and then verify your upload_max_filesize and other php environment settings. Its very possible that your script is dying because one of the max limits is being exceeded.
Depending on your environment you can either use ini_set() to change the necessary values at run-time or you can simply edit your php.ini file to set the value permanently. Please note that not all php.ini settings can be changed at run time and if you do edit php.ini, you will need to restart Apache.
As said by others check your php.in for upload_max_filesize and post_max_size settings. If they are okay and if you are using a 3rd party script for uploading, make sure the script is not limiting the max file size by doing something like:
if( $_FILES["file"]["size"] > (1024 * 1024) ) // disallow uploads > 1MB
{
// max size exceeded.
}

Categories