WXforum.net
May 23, 2013, 10:18:18 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
Members: 6619  •  Posts: 178749  •  Topics: 18134
Please welcome moranbahweather, our newest member.
Welcome to the the new hosting for WXforum.net.
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Error in logs from Carter Lake PHP site scripts  (Read 595 times)
0 Members and 1 Guest are viewing this topic.
Arthurhh
Senior Contributor
****
Offline Offline

Posts: 251


IT Fixer


WWW
« on: October 09, 2010, 05:55:50 PM »

I am getting the following error in my apache server error logs.

[Sun Oct 10 10:44:50 2010] [error] [client 207.46.92.16] PHP Notice:  Undefined index: REMOTE_HOST in C:\\wamp\\www\\tok\\Settings.php on line 35
[Sun Oct 10 10:44:53 2010] [error] [client 207.46.92.16] PHP Notice:  Undefined index: REMOTE_HOST in C:\\wamp\\www\\tok\\Settings.php on line 35

Below are lines 32 onward of the file mentioned (I have added line numbers for clarity)

(32) # Automatic Info we might need
(33) ############################################################################
(34 )$SITE['REMOTE_ADDR']   = $_SERVER['REMOTE_ADDR'];
(35) $SITE['REMOTE_HOST']   = $_SERVER['REMOTE_HOST'];
(36) $SITE['WEBROOT']      = $_SERVER['DOCUMENT_ROOT'];
(37) $SITE['REQURI']         = $_SERVER['REQUEST_URI'];
(38) $SITE['SERVERNAME']      = $_SERVER['SERVER_NAME'];

I am running Apache2.2.11 with PHP 5.3.0

Anyone cast light on this error, I believe the variable id a default in PHp but may be wrong.

Logged

graculus
Senior Contributor
****
Offline Offline

Posts: 251



« Reply #1 on: October 09, 2010, 06:08:30 PM »

The php manual says:

'REMOTE_HOST'
The Host name from which the user is viewing the current page. The reverse dns lookup is based off the REMOTE_ADDR of the user.
Note: Your web server must be configured to create this variable. For example in Apache you'll need HostnameLookups On inside httpd.conf for it to exist.

Is it?
Logged
Arthurhh
Senior Contributor
****
Offline Offline

Posts: 251


IT Fixer


WWW
« Reply #2 on: October 09, 2010, 07:18:13 PM »

It is set in the virtual hosts conatiner for this site but not in the server httpd.conf. I will add it there and see if that makes a difference.
Logged

saratogaWX
Administrator
Forecaster
*****
Offline Offline

Posts: 3741


Saratoga, CA, USA Weather - free PHP scripts


WWW
« Reply #3 on: October 09, 2010, 07:35:01 PM »

The other suggestion is to turn off the Notice: error display (pesky things) by putting in the php.ini file:

error_reporting = E_ALL & ~E_NOTICE;

Best regards,
Ken
Logged

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP
Arthurhh
Senior Contributor
****
Offline Offline

Posts: 251


IT Fixer


WWW
« Reply #4 on: October 09, 2010, 07:42:47 PM »

Well blow me down it achieved the result I desired in the Virtual container, but most have to be in the httpd.conf to achieve a result for this section of the script, I guess it is to do with it being global for the server rather than the virtual host.

I also guess your on rogers cable connection. (I love logs they are a great source of entertainment)
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.198 seconds with 19 queries.