Search code examples
phperror-log

PHP Error Log - meaning of the [client] column


If I look at my PHP error log, I see something like this:

[Sun Aug 10 23:49:12 2014] [error] [client 1.2.34.567] PHP Fatal Error: XYZ

What is the meaning of the [client] column in the error log? Is it the IP address of the machine that triggered the error? How does PHP generate the IP address (if it is, indeed, an IP address)?


Solution

  • Yes, it is the client IP address. The client has an IP address and uses this to communicate with the web server, so it has this information. It is the web server and not PHP, though the web sever can and normally does make this available to PHP.

    This could be the IP of the actual client machine running the browser, or it could be the IP of a proxy or NAT (Network Address Translation) device that the client uses to access the Internet.