I
I
ideological2017-05-13 22:36:06
PHP
ideological, 2017-05-13 22:36:06

How to find error url with php-fpm?

Hello,
in the php-fpm error log I see some error, for example:
"[13-May-2017 15:18:00 UTC] PHP Warning: Invalid argument supplied for foreach() in /var/www/site.ru/ front.php on line 204"
the question is how to find out which request/url resulted in the error?
At the same time, there are no errors with this time in the nginx log (in the config it is set to write everything from the notice level).
What is done in such cases?
Is it possible to somehow set, for example, the format of the php-fpm log?
--
just in case detailed
in nginx
error_log /var/log/nginx/error.log notice;
written in php.ini for fpm
error_reporting = E_ALL
error_log=/var/log/phpfpm_errors.log
logs are well written
But how do you find out the url of the request that resulted in the error?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2017-05-14
@ideological

php.net/manual/en/install.fpm.configuration.php#ac...
www.tothenew.com/blog/php5-fpm-logging
%R : remote IP address
%u : remote user (you dont see these two in output of tail -f)
%t : server time of receiving request
%m : method
%r : request uri {Additional : %q:if query string exists, %Q: the ? character is query
string exists }
%s: status response
%f : script filename
%d : time taken to serve request (in mili seconds)
%M : peak memory allocated by php (in kilobytes)
%C : CPU used by request
Example:

17/May/2015:09:41:04 +0000 "GET /wp-admin/install.php" 200 /var/www/wp-admin/install.php 218.177 2816 87.09%

F
Fortop, 2017-05-13
@Fortop

In fact, the corresponding request should fail and this will be reflected in the nginx logs with 500, 502, 499 and other abnormal request termination statuses

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question