0

i want to upload multiple images on server but it is giving me errors below

enter image description here

i have increased the memory limit size and time execution but still it is giving me error on live site but now it started working on localhost.

ini_set('memory_limit','256M');
ini_set('max_execution_time', 300000);

when i upload small size picture on live server then it works properly but when i upload an image of 4 MB then it show error "Site can't be reached"

is there any limitation of memory_limit or execution time on live server or something else??

Any help?

BenRoob
  • 1,662
  • 5
  • 22
  • 24
john
  • 611
  • 1
  • 7
  • 33
  • Which web server do you use? Please have a look at its config. You may have to adjust settings - e.g. max size of posted request body. There are also some more tweaks in php config like described [here](https://stackoverflow.com/questions/9691057/php-apache-ajax-post-limit). – BenRoob Dec 04 '17 at 16:37
  • i dont have server access therefore i increased the memory_limit and execution_time through code but still not working on live server. – john Dec 04 '17 at 16:39
  • Possible duplicate of [Increasing the maximum post size](https://stackoverflow.com/questions/6135427/increasing-the-maximum-post-size) – aynber Dec 04 '17 at 16:39
  • it is working properly on localhost through this code ini_set('memory_limit','256M'); ini_set('max_execution_time', 300000); but why not on live server? – john Dec 04 '17 at 16:44
  • Then you have to find out differences between localhost and your live server - or contact your admin. How should we know? ;) – BenRoob Dec 04 '17 at 16:46
  • is there any limitation to upload large file on live server?? – john Dec 04 '17 at 16:50
  • Further, you should reconsider the *max_execution_time* - it is set in seconds. – BenRoob Dec 04 '17 at 16:50
  • i have set it to ini_set('max_execution_time', 300000); – john Dec 04 '17 at 16:52
  • There could be limitations. E.g. you can adjust the maximum body size of requests in the configuration of apache or nginx web server. – BenRoob Dec 04 '17 at 16:52
  • As noted in the duplicate, those aren't the only settings you need to be looking at. There are a few post_size variables you need to adjust as well – aynber Dec 04 '17 at 16:52
  • 300.000 seconds. There should be no need - if uploads work - to set this huge value. – BenRoob Dec 04 '17 at 16:53
  • @aynber how to adjust post_size variables? – john Dec 04 '17 at 16:56
  • You can use the same `ini_set` with those variables. If it doesn't work, you'll have to talk to your host. – aynber Dec 04 '17 at 17:07
  • i have set the post_size variables but still error "Entity too large" – john Dec 04 '17 at 17:24

0 Answers0