Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

faizan1041's avatar

Gateway Timeout with PHP,NGINX and Laravel

I'm using a Godaddy VPS with Nginx, PHP and Laravel installed on Ubuntu 14.04, I have page where I'm sending request to Paypal REST API, that works on my local machine and the response is returned with a view. But after deploying it on VPS, I'm running through this issue. I have tried changing all the ini settings, here's the piece of phpinfo(); after changing values in the ini and conf files:

max_execution_time  3000    3000
max_file_uploads    20  20
max_input_nesting_level 64  64
max_input_time  6000    6000
max_input_vars  1000    1000
memory_limit    128M
post_max_size   8M
default_socket_timeout  60  60

and

     fastcgi_buffers 8 16k;
     fastcgi_buffer_size 32k;
     fastcgi_connect_timeout 3000;
     fastcgi_send_timeout 3000;
     fastcgi_read_timeout 3000;

in my /etc/nginx/sites-available/default file. After changing each possible value I have ended up posting it here and the page still shows 504 timeout error. Any help?

0 likes
4 replies
faizan1041's avatar
faizan1041
OP
Best Answer
Level 1

Strange! I changed my connection and it works, however the previous one was faster. Any explanation to this?

bashy's avatar

Changed what connection?

I'd try set buffers to fastcgi_buffers 16 16k; as well. Have a look in php fpm logs for the issue.

faizan1041's avatar

@bashy Yes, I changed the Internet connection and it works, I even tried setting this: fastcgi_buffers 16 16k;

faizan1041's avatar

@bashy Switched over to the previous connection and same thing happened, got a 504 error, here's the php-fpm log for that request:

[28-Jul-2016 04:05:46] NOTICE: fpm is running, pid 956
[28-Jul-2016 04:05:46] NOTICE: ready to handle connections
[28-Jul-2016 04:05:46] NOTICE: systemd monitor interval set to 10000ms

Please or to participate in this conversation.