Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
обработка nginx-ом stderr полученного от fast cgi сервера
- To: "nginx-ru@xxxxxxxxx" <nginx-ru@xxxxxxxxx>
- Subject: обработка nginx-ом stderr полученного от fast cgi сервера
- From: Alexandr Gevlichenko <Alexandr.Gevlichenko@xxxxxxxxxxxx>
- Date: Thu, 27 Nov 2008 17:51:40 +0200
- Accept-language: ru-RU, en-US
- Acceptlanguage: ru-RU, en-US
- Content-language: ru-RU
- Thread-index: AQHJUJ/3zOCSq90LskKZEzMksjDH7A==
- Thread-topic: обработка nginx-ом stderr полученного от fast cgi сервера
Работает связка nginx+php-fpm.(nginx 7.22, centos 5.2)
При получении от php-fpm сообщений в stderr(warnings¬ice) nginx не верно
обрабатывает их, поведение напоминает переполнение буфера для stderr.
Вот пример php скрипта который воспроизводит ошибку:
<?php
$array = array();
for ($i = 1; $i < 20; $i++)
{
if ( $array[$i] == 1) {
print "test\n";
}
}
print "done\n";
?>
При $i<20 работает как положено, в лог ошибок пишется:
2008/11/27 18:40:19 [error] 5656#0: *4218 FastCGI sent in stderr: "PHP Notice:
Undefined offset: 1 in /home/www/host/nginx.php on line 6
PHP Notice: Undefined offset: 2 in /home/www/host/htdocs/nginx.php on line 6
PHP Notice: Undefined offset: 3 in /home/www/host/htdocs/nginx.php on line 6
........................
PHP Notice: Undefined offset: 18 in /home/www/host/htdocs/nginx.php on line 6
PHP Notice: Undefined offset: 19 in /home/www/host/htdocs/nginx.php on line
6" while reading response header from upstream, client: 193.201.80.94, server:
host, request: "GET /nginx.php HTTP/1.1", upstream: "fastcgi://127.0.0.1
При 40 итерациях в логе:
2008/11/27 18:44:50 [error] 5656#0: *4262 FastCGI sent in stderr: "PHP Notice:
Undefined offset: 1 in /home/www/host/htdocs/nginx.php on line 6
PHP Notice: Undefined offset: 2 in /home/www/host/htdocs/nginx.php on line 6
....................
PHP Notice: Undefined offset: 20 in /home/www/host/htdocs/nginx.php on line 6
PHP Notice: Undefined offset: 21 in /home/www/host/
При 200 итерациях:
2008/11/27 18:47:25 [error] 5656#0: *4285 FastCGI sent in stderr: "PHP Notice:
Undefined offset: 1 in /home/www/host/htdocs/nginx.php on line 6
PHP Notice: Undefined offset: 2 in /home/www/host/htdocs/nginx.php on line 6
PHP Notice: Undefined offset: 3 in /home/www/host/htdocs/nginx.php on line 6
....................
PHP Notice: Undefined offset: 20 in /home/www/host/htdocs/nginx.php on line 6
PHP Notice: Undefined offset: 21 in /home/www/host/
2008/11/27 18:48:25 [error] 5656#0: *4285 upstream timed out (110: Connection
timed out) while reading response header from upstream, client: 193.201.80.94,
server: host, request: "GET /nginx.php HTTP/1.1", upstream:
"fastcgi://127.0.0.1:9000", host: "host"
--
Best Regards,
Alexandr Gevlichenko
|