LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   error running script on crontab (https://www.linuxquestions.org/questions/linux-newbie-8/error-running-script-on-crontab-300349/)

haora 03-11-2005 06:27 AM

error running script on crontab
 
Hi all..., got a new problem......

I've got a crontab that runs a script that call a php script...., the thing is..., when I run that script mannualy from the directory it is in..., there is no problem..., but when I run it from "/" (wich is exactly what the crontab does) the php script tells me that it can't find a file to include.....

The file, of course exists..., and is where it is supposed to be...

I'm running out of ideas here..., I thought it could be a permissions problem..., but I changed them ..., and nothing happened...

Any ideas???

Thanks in advance...

TazG 03-11-2005 06:34 AM

What if you put "cd <directory where php script is>" in the script right before the php script is called?

haora 03-11-2005 06:39 AM

Thanks!, you solved my problem..., altough I don't know why that happened in the first place...., any ideas??

TazG 03-11-2005 04:02 PM

Because, since it is run from "/", the PHP script was looking for it's files at "/"... and by using the cd command before you call it you change the directory so it can find them.


All times are GMT -5. The time now is 09:26 AM.