0

Hello I've a little problem... When i upload files, the $_POST variable returns false like it took too much time so the datas have been forgotten by the server.. Have you an idée to solve this problem? A "php.ini" value to change? If it can help, i' upload only large jpg files. I think the problem is not the "max file upload" variable or "max execution time" because the uploading page loads..And I don't have any error but only the once i told my script to show if an imput is empty. Thanks! :)

Greg
  • 87
  • 1
  • 8

1 Answers1

0

Try changing upload_max_filesize and post_max_size to whatever value you like in your php.ini. Usually its 8MB by default.

You can also do this via an .htaccess file by adding the following code:

; Maximum file size of post data that PHP will accept.
post_max_size = 20M//whatever you want here

; Maximum allowed file size for uploaded files.
upload_max_filesize = 20M//whatever you want here
someguy234
  • 559
  • 4
  • 17
  • Thanks :) I'm hosted by Ovh and it seems i can't edit directly the php.ini; So i've tried with a .htacces file and i've wrote `post_max_size 100M` `php_value post_max_size 10M` `php_value max_input_time 900` `php_value max_execution_time 300` but it returns an internal server error... – Greg Aug 05 '14 at 20:50
  • First you can check you php configuration using . Second can you post your whole .htaccess file. – someguy234 Aug 05 '14 at 21:00
  • I think max_input_time is the problem... the others variables we spoke about are goods but max_input_time is set to "-1"...Is that only possible???? you can check it there: [link]http://welcometomydream.fr/php.php[link] I've sent you the whole .htaccess file, i didn't wrote anything else in.. – Greg Aug 05 '14 at 21:12
  • Are you able to upload smaller files though? Because if its set to a negative value I'm not sure if you are even allowed to upload. Can you check that? Also http://stackoverflow.com/a/2992630/3908355 – someguy234 Aug 05 '14 at 21:19
  • Yep, i've uploaded ~3mb~ files. (I've though exactly what you've told me, that a wired value...). I've paid 85€ so Ovh could, at less, allow me to change that value... i'm so disapointed... – Greg Aug 05 '14 at 21:38
  • Unfortunately thats how it is with these hosting providers which is why getting a vps or a dedicated server is better. Hope it all goes well for you! :) – someguy234 Aug 05 '14 at 21:50
  • 1
    Oh wait i'm just remembering i heard of a ".ovhconfig" at the root of the server... No illusions, i thinks it's gonna do nothing but p*ss me off a little bit more again... :') Anyway, many thanks for your help! :) – Greg Aug 05 '14 at 21:55