1

I am facing a problem while uploading a file/ image in PHP. When I uplopad an 8kb file it works fine but when I upload more that 50kb file it keeps on loading and do nothing, I have checked upto 5 mins. The path to phpinfo() on my server is http://kogd.tw/jatin.php

I have tried to set following variables in my .htacess file but nothing worked.

php_value file_uploads  On
php_value memory_limit  1024M
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

Can anyone please help me regarding it.

To know the problem more, please try to upload a file on link http://kogd.tw/jatin_upload.php

Jatin Seth
  • 312
  • 1
  • 4
  • 19
  • Turn on error reporting: error_reporting(E_ALL);, then any error should appear, in phpinfo() i see other vaules then that you show. It could be also caused server configuration, not php, but then you should see error from server ;/ – Grzesiek Sep 04 '14 at 11:10
  • Nothing happened, when I click on submit the page keeps on loading for unlimited time, Can you please suggest server settings so that I can ask my server provider – Jatin Seth Sep 04 '14 at 11:13
  • Put the phpinfo back. – Slavic Sep 04 '14 at 11:14
  • It's back, phpinfo() has been put back – Jatin Seth Sep 04 '14 at 11:15

1 Answers1

0

You can try to cahnge de default values with ini_set

ini_set("upload_max_filesize","60M");
ini_set("post_max_size","64M");

change the MB whatever you want to.

Santa's helper
  • 976
  • 8
  • 21
  • Please suggest what I need to change like which parameter and what should be it's value. – Jatin Seth Sep 04 '14 at 11:17
  • I am just uploading 83kb file and it's not working, If you check phpinfo then these parameters already have values 64M and 8M. Still I added it and check but it did not work. – Jatin Seth Sep 04 '14 at 11:29
  • i have read some at php.net take a look at: Many settings, although they do get set, have no influence in your script.... like upload_max_filesize will get set but uploaded files are already passed to your PHP script before the settings are changed. Try to change it from php.ini and restart your webserver with graceful option – Santa's helper Sep 04 '14 at 11:46
  • I am just uploading 83kb file and it's not working, If you check phpinfo then these parameters already have values 64M and 8M. Still I added it and check but it did not work. – Jatin Seth Sep 04 '14 at 12:18
  • 2
    please take a look at [this issue](http://stackoverflow.com/questions/11686288/apaches-limit-to-post-request-size) – Santa's helper Sep 04 '14 at 13:05