You are here: PHP and Crontab and Current Directory « PHP Programming Language « IT news, forums, messages
PHP and Crontab and Current Directory

Posted by roger.moon2 on 04/25/07 21:03

So I wrote a script and at the top it checks whether a file exists
like below

if (!file_exists("settings.ini"))
return false;

and the crontab entry:

00 08 * * 4 /usr/local/bin/php /home/user/scripts/test.php > /dev/null
2>&1

however everytime it runs via cron, it can't find the file
settings.ini because it keeps looking for it in $HOME not in $HOME/
scripts/ where test.php resides

Why? And how can I re-code it to look in the current directory not in
$HOME? I tried ./settings.ini but without success

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация