Relative path in cron jobs php

by Prakash 2011-08-20 11:12:27

Relative paths in cron jobs like:

include 'classes/class.myclass.php';

may not work in cron jobs.

Sad



Because the working directory of the cron may be different from your running file.


But it is time consuming to change every relative path to absolute right Question


Idea

Changing the working directory of the file helps Exclamation


Use the following line before your code to do that Neutral


chdir(dirname(__FILE__));


Cool








Tagged in:

706
like
0
dislike
0
mail
flag

You must LOGIN to add comments