Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Try raising max_execution_time setting in php.ini file (CentOS path is /etc/php.ini): max_execution_time = 300Fix 504 Gateway Timeout using Nginx

#Step 1
Raise max_execution_time setting in php.ini file (CentOS path is /etc/php.ini):
max_execution_time = 300

#Step 2
/etc/php-fpm.d/www.conf
Then set the variable to the same value as max_execution_time:
request_terminate_timeout = 300


#Step 3
Add fastcgi_read_timeout variable inside our Nginx virtual host configuration:

location ~ .php$ {
	root /var/www/sites/nginxtips.com;
  try_files $uri =404;
  fastcgi_pass unix:/tmp/php5-fpm.sock;
  fastcgi_index index.php;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  include fastcgi_params;
  fastcgi_read_timeout 300;
}
Source by easycloudsupport.zendesk.com #
 
PREVIOUS NEXT
Tagged: #Try #raising #setting #file #path #Gateway #Timeout #Nginx
ADD COMMENT
Topic
Name
1+6 =