PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
But recently I coded a script for cron jobs.
It works fine when you do it manually, but when I try to make it go through cron jobs, it comes up with this error:
Could not open input file: /home/lincoln/public_html/restock.php?shop=3.
Now yes I know it uses the get function and I was wondering if that's whats screwing it up....
Most problems with Cron come form invalid permissions. Every user can have cron jobs. They are all different. So if you e.g. manually start a script as root it of course works. If you then start cron as user files might not be read due to wrong set permissions etc.
Might also have to do with path variables that a user have but cron might not.
Another problem might be that cron simply starts your program at the wrong point. Lets say you start a sript with ./sriptname.cgi and all works fine because you are in that directory. If cron starts this file it is not in that directory and variable pathing in that script might not resolve properly.
e.g in perl sripts I usally do something like this:
The directory and permissions are fine its just the evil variable,
And as much as I would Like to do it your way, I cant because the whole script basically depends on that variables, it tells which items to get, where to stock the items, how many to stock, ect.