Question

I have a Phonegap App running in android, and my backend is a php App using Yii framework.

When I try to upload 10 pics, sometimes it works well, sometimes, some pics fail to upload.

In my error_logs, I have this line :

[Mon Mar 03 16:59:22 2014] [warn] [client 148.240.71.124] (70007)The timeout specified has expired: mod_fcgid: can't get data from http client 

I don't know how to manage it. I tried to raise timeout values in : /etc/apache2/mods-enabled/fcgid.conf

but nothing changes after restarting apache In my apache2.conf, I have no part describing mod_fcgid. Should I add one?

Any suggestion???

Was it helpful?

Solution

You will need change few things in your php.ini file

  1. max_execution_time = 1500; or more as per your need
  2. max_input_time = 1500; or more as per your need
  3. post_max_size = 500M; or more as per your need

OTHER TIPS

This happens when you are using mod_fcgid and the settings don't allow requests to run long enough. You will need to tinker with the values in the fcgid.conf. On Red Hat systems, the file is located at /etc/httpd/conf.d/fcgid.conf and for Debian-like OS's it's at /etc/httpd/conf.d/fcgid.conf.

Specific settings will depend on your hardware and software setup, but the following are pretty safe for a low-powered server:

FcgidIdleTimeout 60
FcgidProcessLifeTime 30
FcgidMaxProcesses 50
FcgidMaxProcessesPerClass 8
FcgidMinProcessesPerClass 0
FcgidConnectTimeout 30
FcgidIOTimeout 45

Another way to go is to switch your processing to Nginx and PHP-FPM instead. If you want to go that way there are plenty of guides online.

There are three different timeouts that must all be configured under PHP-FPM in Apache:

  • Timeout and ProxyTimeout in your main Apache config
  • The timeout on your definition in the virtual host
  • max_execution_time and max_input_time in php.ini

See this serverfault answer, and if you're using SetHandler and UNIX socket for your FPM pool, see my comment to the answer.

I had the same error and it was really simple. I hade debugging to remote host enabled in apache/php and the debugger was not loaded. I disabled the remote debugger and everything started to work fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top