Jump to content

Cron Jobs - notice: Undefined index: SCRIPT_FILENAME in...


Recommended Posts

Posted

What does this error mean and how do I solve it? This is the message I've received via email, although the cron job has really worked:

 

<br />
<b>Notice</b>:  Undefined index: SCRIPT_FILENAME in <b>/home/roguitar/public_html/config.php</b> on line <b>2</b><br />
 
This is the command line I type there in the configuration page: php -q /home/roguitar/public_html/emailscript.php

 

And the time interval was set to every day at 9 p.m. Sao Paulo, Brazil timezone...

 

Posted

It means you referenced an array index that isn't set. Your code probably references something like $array["SCRIPT_FILENAME"], but $array does not contain an index called SCRIPT_FILENAME. You'll need to debug your code.

 

If you just want to hide the errors, you can add error_reporting(0); near the start of your file.

Posted (edited)

It means you referenced an array index that isn't set. Your code probably references something like $array["SCRIPT_FILENAME"], but $array does not contain an index called SCRIPT_FILENAME. You'll need to debug your code.

 

If you just want to hide the errors, you can add error_reporting(0); near the start of your file.

Yep! Now it makes total sense. I'm really using error_reporting(E_ALL) at the beginning. But... there's no such thing as "SCRIPT_FILENAME in my code". And yes, I do use arrays in there, but they're all necessary for retrieving data from database, and updating things there... Anyway, what may have happened though is that the $email variable is set to be anything retrieved from database inside a while loop. That being said, considering that I'm not sure, I guess this is likely to cause this type of error, once the $email variable is repeated multiple times (while loop) but with different values along the way, if at all you understand what I mean... Well, I imagine that that's it. But thanks...

Edited by roguitar

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...