show hostname in php_error.log ?

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
rontober
Forum Newbie
Posts: 2
Joined: Mon Feb 06, 2006 8:10 am

show hostname in php_error.log ?

Post by rontober »

for a server that runs multiple domains, i was just wondering if it is possible to display the hostname that generates the error in php_error.log?

i've looked around but cant find it so far, it would be a very handy functionality. Many thanks in advance.

Oh and that's PHP4.3 with Apache2
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

check out the $_SERVER variables.. there' s a few in there that may be of interest.
rontober
Forum Newbie
Posts: 2
Joined: Mon Feb 06, 2006 8:10 am

Post by rontober »

$_SERVER['SERVER_NAME']

that looks like (something similar to) what i want.

Can i simply include this in php.ini in some way, or do i need to rewrite the error handler for each php file?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

oops, I misread your post.

Apache has internal variables set for SERVER_NAME when dealing with logs:

http://httpd.apache.org/docs/1.3/mod/mo ... ml#formats
Post Reply