RE: [PHP] why is SERVER_ADDR empty from command line script?

From: Date: Sun, 11 May 2003 23:43:00 +0000
Subject: RE: [PHP] why is SERVER_ADDR empty from command line script?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-147237@lists.php.net to get a copy of this message
Soooo... Then is there a PHP variable that will tell my my IP address? Seems silly that PHP doesn't know it's own IP address? I understand there may be multiple ones on a machine, but I would think that is the rare case not the norm. I mean, at least it should return whatever is the default for the machine (eth0?). *sigh* > -----Original Message----- > From: Mark Charette [mailto:charette@woodwind.org] > Sent: Sunday, May 11, 2003 4:30 PM > To: Daevid Vincent; PHP general mailing list > Subject: RE: [PHP] why is SERVER_ADDR empty from command line script? > > > > -----Original Message----- > > From: Daevid Vincent [mailto:daevid@daevid.com] > > > > How come I can't get my SERVER_ADDR when running a script via the > > command line (yet it works if I run it via web page)? > > Uh, because you're running your script in the context of a > command line > instead of the context of a Web server ?? > > (Hint - a server sets SERVER_ADDR ...) > >

« previous php.general (#147237) next »