-1

Ajax gives 503 Service Unavailable error while uploading files greater than 10mb on the server but it uploads files less than 10mb successfully, It works well on my local server on my computer but it gives this error on my host server, I've tried editting my MultiPHP INI Editor file on my domain server I set

max_input_time to -1, 
upload_max_file_size to 800mb 

but it still gives me the same error

I've searched all over the internet I couldn't find the solution, please help me resolve this, thanks.

Paulos Ab
  • 319
  • 4
  • 16
  • 2
    *'I've searched all over the internet"* - I doubt that. --- *"I've tried editting my php.ini file on my server I set max_input_time to -1, upload_max_file_size to 800mb":* - Did you restart everything after making those changes? – Funk Forty Niner Jul 06 '20 at 13:38
  • There’s another very important setting, https://stackoverflow.com/questions/2184513/change-the-maximum-upload-file-size – CBroe Jul 06 '20 at 13:45
  • Did you also check `post_max_size` and `memory_limit` assuming you are going for `upload_max_file_size = 800M` then you want to make `post_max_size = 900M` and `memory_limit=1G` – RiggsFolly Jul 06 '20 at 13:47
  • thanks for answering my question, please how do I restart my server on my host – Paulos Ab Jul 06 '20 at 20:47

1 Answers1

0

There is already a good answer for the question here.

Go to php.ini file and change value with respect to your requirements.

upload_max_filesize

By default this value is 2M. We need to increase it to the maximum size of single file that we want to upload.

max_input_time

This sets the maximum time in seconds a script is allowed to parse input data, like POST and GET. Timing begins at the moment PHP is invoked at the server and ends when execution begins. This would include populating $_FILES superglobal.

memory_limit

This sets the amount of memory a PHP script is allowed to use during its execution. Set this to a value greater than ‘post_max_size’ so that PHP script can load and process the uploaded file.

post_max_size

It defines the maximum size of POST data that PHP will accept. This value should be greater than ‘upload_max_filesize’.

max_execution_time

The time a script is allowed to run after its input has been parsed. This would include any processing of the file itself.

If you are getting memory related error then turn off the output buffering, the PHP configuration directive to be considered is “output_buffering

output_buffering = Off

One thing I would like to add is to double check if the changes you made to the configuration file are live. To do that you can use the phpinfo function which will return all the configuration values in the current environment.

If the changes are not live, make sure to restart the server and/or check if you edited the correct .ini file which is also mentioned in the phpinfo output.

IgorR
  • 75
  • 10
  • thanks for your answer, i've edditted it in the MultiPHP INI Editor file in my host domain, but it's still giving me the same error 503 Service Unavailable – Paulos Ab Jul 08 '20 at 13:32