0

Environment (shared hosting):

Versión Apache 2.4.41

Versión PHP 7.0.1

Versión MySQL 10.0.38-MariaDB-cll-lve

PHPMailer 6.1.4

I'm sending email messages using AWS SNS SMTP service through PHPMailer, -all configuration is well-, I made tests and worked good (1 or 2 messages), so, in production, I'm sending 100 email messages each 5 min (is not spam) but after 1m the scrip is broken. I don't get any error message in logs and screen, I only can see in the console that the script is broken after 1m the body is empty. (Image below)

Image blank

NOTES

  1. If I only send 50 email messages each time, the script is NOT broken.

  2. If I run the following script:

for($i = 1; $i < 131; $i++){
  echo $i.'<br>';
  sleep(1);
}

I get:

Error 500 Request Timeout This request takes too long to process, it is timed out by the server. If it should not be timed out, please contact administrator of this web site to increase 'Connection Timeout'.

after 2m.

  1. I have the following configuration in script
error_reporting(E_ALL);
ini_set("display_errors", 1);
ini_set('memory_limit', '-1');
ini_set('max_execution_time', 12000);
ignore_user_abort(TRUE);
ini_set("default_socket_timeout", 6000);
  1. I have the following code in .htaccess
php_value default_socket_timeout 6000
TimeOut 6000

I tried the changes mentioned here but don't works.

Community
  • 1
  • 1
e-israel
  • 623
  • 10
  • 30

1 Answers1

0

Finally, after searching for a lot of options, I found the solution. This solution is about a special configuration for Litespeed.

Added in .htaccess in root directory for all request

RewriteRule .* - [E=noabort:1]
RewriteRule .* - [E=noconntimeout:1]

Run PHP without Timeouts - Litespeed Doc

e-israel
  • 623
  • 10
  • 30