Jump to content

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


roguitar

Recommended Posts

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...

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...