Home  >  Forum  >  PHP
Post New Query

[FIXED] 504 Gateway Timeout Error in Sending Mail with PHP



Asked on May 09, 2021
Hi,
I have a mailing application in php using PHPMailer. When I attach files with bigger size, after sometime it throws error 504 Gateway Timeout but mails are sent successfully. 
Kindly help me to resolve this issue.



Replied on May 09, 2021
Try following configuration changes.

1. Increase Request Timeout in Apache Server

   TimeOut 1500

After updating timeout, restart Apache Web Server.

2. In php.ini, update below values.

upload_max_filesize = 128M
post_max_size = 128M
max_input_time = 1500
max_execution_time = 1500
default_socket_timeout = 6000


3. You can also use set_time_limit() on top of php page that is sending mail.

set_time_limit(1500);




Replied on May 09, 2021
Thanks. It worked.

Write Answer











©2021 concretepage.com | Privacy Policy | Contact Us