dxshindeo Posted July 5, 2012 Report Share Posted July 5, 2012 Hi, everyone! I can't upload files bigger than 1,90 MB. 1,89 still works fine, but server refuses if higher. php.ini -> post_max_size = 100M upload_max_filesize = 100M Actually, the problem was that I was able to upload only 1 MB, problem was in mysql, fixed it by running sql commands: SET GLOBAL max_allowed_packet = 104857600; /*Theoretically this should let me upload and insert files with maximum size of 100 MB, but practically it raised the bar from 1 MB to 1,90 MB*/ SET GLOBAL net_read_timeout = 3600; /*This was 30, dunno why I even touched this*/ Field in mysql has LONGBLOB type, so it can contain a file ~4GB. Working with Win7 and I have installed and configured Apache2.2, MySQL Workbench 5.2.40 and PHP 5.2.17 (VC6 x86 Thread Safe version). Would appreciate any thoughts on the matter Quote Link to comment Share on other sites More sharing options...
daGrevis Posted July 5, 2012 Report Share Posted July 5, 2012 Have you restarted httpd (or any other web server you have) and, just to be sure, mysqld? Quote Link to comment Share on other sites More sharing options...
dxshindeo Posted July 5, 2012 Author Report Share Posted July 5, 2012 Using Apache2.2, in httpd configuration file added: LoadModule php5_module "c:/php/php5apache2_2.dll AddType application/x-httpd-php .php" So the Apache can interact with PHP. Restarted Apache, nothing changes. What did you meant by mysqld? Checked my processes, have httpd and mysqld both up and running. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted July 5, 2012 Report Share Posted July 5, 2012 I meant that you should restart MySQL daemon (process, if you are using Windows). But, anyway, it won't change anything... What's the exact response from server when you are trying to upload file higher than 1.9 Gb. Any error? Quote Link to comment Share on other sites More sharing options...
dxshindeo Posted July 5, 2012 Author Report Share Posted July 5, 2012 "1.9 Gb" - 1.9 MB :) Ok, here's part of my code (big query and an if-else statement): $result = mysql_query("INSERT INTO arhivs (prieksmets, prieksmets_full_name, nosaukums, tips, formats, izmers, autors, datums, laiks, path, saturs) VALUES ('$prieksmets', '$prieksmets_full_name', '$fileName', '$fileType', '$fileExt', '$fileSize', '$autors', '$datums', '$laiks', '$newpath', '$content')"); if($result==true) { move_uploaded_file($_FILES["userfile"]["tmp_name"],$newpath); echo "Fails veiksmīgi pievienots. Paldies!"; } else { echo mysql_error(); } If file is < than 1.90 MB, everything echoes fine, but when it's >- 1.90 MB then it's supposed to show why query can't be executed, but it doesn't. Quote Link to comment Share on other sites More sharing options...
dxshindeo Posted July 5, 2012 Author Report Share Posted July 5, 2012 (edited) I mean it threw out an error "Mysql server has gone away". Executed this line which solved the problem with that error. But now nothing shows. SET GLOBAL net_read_timeout = 3600; Edited July 5, 2012 by dxshindeo Quote Link to comment Share on other sites More sharing options...
dxshindeo Posted July 5, 2012 Author Report Share Posted July 5, 2012 Found the problem. Was in my own code. <input type="hidden" name="MAX_FILE_SIZE" value="2000000"> This is what kept the problem persistant. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted July 6, 2012 Report Share Posted July 6, 2012 Why are you speaking English, but columns in your code are in Latvian?? Quote Link to comment Share on other sites More sharing options...
Kavacky Posted July 6, 2012 Report Share Posted July 6, 2012 Wannabijs. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.