LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-11-2005, 06:27 AM   #1
haora
Member
 
Registered: Mar 2005
Distribution: SuSE 9.1, Ubuntu 5.10
Posts: 69

Rep: Reputation: 15
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...
 
Old 03-11-2005, 06:34 AM   #2
TazG
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Gentoo 2004
Posts: 133

Rep: Reputation: 15
What if you put "cd <directory where php script is>" in the script right before the php script is called?
 
Old 03-11-2005, 06:39 AM   #3
haora
Member
 
Registered: Mar 2005
Distribution: SuSE 9.1, Ubuntu 5.10
Posts: 69

Original Poster
Rep: Reputation: 15
Thanks!, you solved my problem..., altough I don't know why that happened in the first place...., any ideas??
 
Old 03-11-2005, 04:02 PM   #4
TazG
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Gentoo 2004
Posts: 133

Rep: Reputation: 15
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error running postrotate script... Jake_B Red Hat 0 09-19-2005 04:34 PM
libmysqlclient error when running a php script rose_bud4201 Linux - Software 2 06-03-2005 01:43 PM
Error while running .bin script: missing libXp.so brunnopessoa Linux - Software 2 10-22-2004 08:41 PM
cron error when running script? meeble Linux - Software 3 09-09-2004 05:00 PM
Shell script running via crontab problem. thetruethugg Linux - Software 13 12-19-2003 08:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration