php - 504 Gateway Time-out media temple -
i getting 504 gateway errors when php script needs run longer 60 secs.
i on media temple on dedicated server. have contacted media temple , have been helpful none of suggesion seem work me told edit file.
/etc/httpd/conf.d/fcgid.conf
which have below
loadmodule fcgid_module modules/mod_fcgid.so <ifmodule mod_fcgid.c> <ifmodule !mod_fastcgi.c> addhandler fcgid-script fcg fcgi fpl </ifmodule> fcgidipcdir /var/run/mod_fcgid/sock fcgidprocesstablefile /var/run/mod_fcgid/fcgid_shm fcgididletimeout 300 fcgidmaxrequestlen 1073741824 fcgidprocesslifetime 10000 fcgidmaxprocesses 64 fcgidmaxprocessesperclass 15 fcgidminprocessesperclass 0 fcgidconnecttimeout 600 fcgidiotimeout 600 fcgidinitialenv rails_env production fcgididlescaninterval 600 </ifmodule> so have tried max as can, test running function below.
function test504(){ @set_time_limit(0); sleep(60); echo "true"; } sleep work on value below 60 seconds returning true on 60 504 gateway error.
my phpinfo(); outputs
max_execution_time 600 max_input_time 180 i have seen few post on increasing fastcgi_connect_timeout have no idea find on media temple.
can thanks
update still cant fix this
after chatting support have been told need edit nginx.conf ? , directed post http://blog.secaserver.com/2011/10/nginx-gateway-time-out/
cant fine of values on hosting. client_header_timeout client_body_timeout send_timeout fastcgi_read_timeout
my nginx.conf file looks this
#error_log /var/log/nginx/error.log info; #pid /var/run/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 120; #tcp_nodelay on; #gzip on; #gzip_disable "msie [1-6]\.(?!.*sv1)"; server_tokens off; include /etc/nginx/conf.d/*.conf; } this driving me crazy suggestions ???
update managed sorted in end after lots of headache added blog post on how fixed here. http://devsforrest.com/116/boost-settings-on-media-temple-for-maximum-settings
hope helps someone
i had same issue , solved editing nginx.conf file. in cases, can fixed adding / increasing send_timeout directive in nginx.conf.
find nginx.conf file (usually located @ /usr/local/nginx/nginx.conf or /etc/nginx/sites-available/default), open using nano or other text editor, , add following lines between http { } looks like:
http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 120; #tcp_nodelay on; #gzip on; #gzip_disable "msie [1-6]\.(?!.*sv1)"; server_tokens off; send_timeout 10m; include /etc/nginx/conf.d/*.conf; } in case, had increase other directives like:
client_header_timeout 10m; client_body_timeout 10m; send_timeout 10m; fastcgi_read_timeout 10m; too.
once you've edited file, reload nginx with:
kill -hup `ps -ef | grep nginx | grep master | awk {'print $2'}` or
sudo service nginx restart that should fix it.
(i found directives here: http://blog.secaserver.com/2011/10/nginx-gateway-time-out/ )
ps: saw comment op link blog thought adding relevant information here might help.
click for info
ReplyDeletego now
get more
Read More Here
visit here