PHP upload script fail - php

Im using BluImp file uploader. Greate little script that I've used forever.
Now I have scoured there forum and cant find anything but after debugging, I believe it is more of a permissions/restrictions/settings problem.
Once the upload has appeared to have finished, an error is returned:
Error: SyntaxError: Unexpected end of input
After debugging it is cause by any functions writing to the server, i.e. file_put_contents, move_upload_file....
The file is 1.47 mb
my additional ini alterations are
max_execution_time = 1600
max_input_time = 1600
post_max_size = 128M
upload_max_filesize = 128M
Can anyone see anything that I dont?
regards
Also I forgot to add that it does not happen to all files just a few

Related

PHP file upload size limits

I know this question has been asked before, but I've gone through all previously described options and I'm wondering if I'm missing an option. I'm trying upload a file through Apache/PHP that is greater than 2.000GB in size. Files smaller than that work fine.
The following php.ini variables are set, and I have restarted Apache to make sure they are in effect:
max_input_vars = 10000
post_max_size = 5000M
upload_max_filesize = 5000M
max_file_uploads = 1000
max_execution_time = 600
max_input_time = 600
memory_limit = 10000M
I am using a javascript uploader, with no filesize limits in the script, and a PHP page to receive the uploaded files, also with no limits in the script. When it fails, it only gives this error message in the javascript console in Chrome and IE: Failed to load resource: net::ERR_CONNECTION_RESET. There are file size limit checks in the javascript and PHP pages, but those errors are never displayed... so I'm thinking it is not even getting the chance to check the file size in either place.
In case anyone hits this 2.0GB limit, the fix for me was that PHP 5.4 did not support uploads greater than 2.0GB. This limit was changed in PHP 5.6: http://php.net/ChangeLog-5.php#5.6.0
Upgrading to PHP 7.0 worked for me!

Fatala Error in Php with DOM

I have html dom parser and php script to store the table data to mysql. Now I'm getting Fatal Error on line 18. Below is the code of line 18 and is for finding table from HTML Web Page. Also I had applied this script to so many same webpages of different sizes (in kb) and more content but same. Then I found that there is not any problem with the script as it works fine on less sized (like 100kb, 200kb) pages, while it not works with large sized pages having large data (like 800kb, 900kb). So I think there is limit in memory on my server. Please help me resolve this issue.
.......
foreach($html->find('table#GridView1') as $e){
.......
Maybe pastes the Error messages would give us more information to solve the problem...
Anyway, to extend the memory limit in php. All you need to do is edit your php.ini(which maybe in the dirctory /php5/ or /Windows/, it depends.)
Find the content
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = XXM
Change it to the size that satisfies your system. And restart your Apache server.
Open simple_html_dom.php, go to line 65, which has:
define('MAX_FILE_SIZE', 600000);
It's standard put at 600000 which is 600kb, so change it to your desired amount.
Source
Finally after trying so many ways and giving 10 hours to this question, I got the solution. First changed the max_file_size limit in html DOM as tald by #Koen Hoeijmakers. Then the must important factor which we must need to improve in dedicated server having centos 5 and kloxo panel is to change all limits in .htaccess.. as below:
php_value upload_max_filesize 2M
php_value max_execution_time 300
php_value max_input_time 600
php_value memory_limit 320M
php_value post_max_size 80M
and got out of this hell(Error!!). No matter, thanks for your suggestions.

PHP big size file uploading issue

We have a form where we can upload file. We are not able to upload big size files for e.g. > 30 MB.
We have already changed the settings memory_limit, post_max_size and upload_max_filesize to some large number.
But still we get "This web page is not available" error with "Error code: ERR_CONNECTION_RESET" in Chrome . In Chrome we see message like "Uploading %" and after certain %of uploading it throws the error. In short it seems data is itself not posting to action page.
It looks like your upload is being timed out. Try increasing max_input_time in php.ini, ie:
max_input_time = 600
and your php's max_execution_time = ?
http://php.net/manual/en/function.set-time-limit.php
perhaps better to show the code you're using.
For larger file upload use chunk upload.
https://github.com/blueimp/jQuery-File-Upload/wiki/Chunked-file-uploads
Hopefully this will help you.

phpMyAdmin trying to input database, file too big

I am trying to import a database that is 9,451 KB and 1,933 KB zipped up. When I try to import this database I get this error: You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.
I have tried setting the following settings and restarted my local machine and I still get the same error:
upload_max_filesize = 100000000000000000000000000000M
memory_limit = 10000000000000000000000000000000000000M
post_max_size = 1000000000000000000000000000000000000M
max_execution_time = 5000000000000
max_input_time = 500000000000
What Am I doing wrong :(
First thing, there are lot of 0s in your settings!!
You don't require such high allocations. Keep the default settings.
Just change upload_max_filesize = 64M and post_max_size = 64M
Now, getting to the point. Why you problem still persists.
You modified the wrong php.ini file. Check if there's another php.ini file in the system.
You don't require to restart your whole machine. Simply restarting the server would be enough.
Try these and see if it works out!
The phpMyAdmin documentation also has some additional hints, solutions, and workarounds.

PHP: Uploading large files fail

Im confused... I can't seem to upload files in the 2gb range. When i try using curl to send a 1.92gb file to my site (through an API), it doesn't report anything at all, its just blank. When i send a 1kb file, it reports back like it should.
When i try uploading via the upload form, it ends up freezing mid way, around 33%. Although im not sure if only the progress bar has froze or if the actual file upload it self has been suspended. I suspect that only the progress bar has froze because it still says data is being sent even though the progress bar freezes.
My php.ini (yes, its reflected by phpinfo as well):
register_globals = Off
magic_quotes_gpc = Off
post_max_size = 2047M
upload_max_filesize = 2047M
max_execution_time = 25200 ; Maximum execution time of each script, in seconds
max_input_time = 25200 ; Maximum amount of time each script may spend parsing request data
memory_limit = 2048M ; Maximum amount of memory a script may consume (16MB)
short_open_tag = On
My vps doesnt actually have 2gb of ram at its disposal, but does memory_limit really need to be set this high?
How should i go about testing this? I know 400mb files work, i haven't tested anything in between 400mb and 1.92gb
You will need a premium account to test up to 2gb, so here is one you can play with:
User: testreferral
Pass: 1234
http://filefx.com
I dont understand where this problem is arising.
Check for:
Memory limit. Try uploading files above and below the actual memory limit.
Time limit. Aren't your uploads take 7+ hours, are they?
The effective settings. Some setting might be overridden by server/etc settings.
PHP: mysql query skipped/ignored after large file uploads?
Mysql was timing out during the file upload. So the file wasn't showing up in the DB

Categories