undefined index REMOTE_ADDR for cron

Now that I got cron jobs running, I started to see a bunch of errors in my log4php database. It turns out that PHP executed directly from the cgi bin (/web/cgi-bin/php5) instead of through a web browser, leaves out the headers. Since the job was running locally, there was no remote address to look at. I was able to clear up the problem with an “isset” call to determine if the index that I needed was available.

This is a bit of a reliefe to me. I was concerned about people hacking the system by gaining access to this page and never completing the work, or providing bad data back to the site. Since I can detect local connections (those without headers), I can deny access to anyone else attempting to access the page through a web browser.

posted by Dedric Mauriac on Nowhereville using a blogHUD : [blogHUD permalink]

Comments are closed.

%d bloggers like this: