Posted by J.O. Aho on 01/11/06 16:29
Marcel wrote:
> I fact there's nothing that requires a webbrowser for my script.... it seems
> that the problem is/are the files i include in the script with
> require_once() .........but i do not know why....
Okey, I guess it's the paths that may cause your problem (guessing here as you
haven't told what kind of trouble you get).
When you do a cli execution of php, then all paths are counted from the place
where you are, not where the script is located.
Wehn running a batch file from the scheduler, I think the path will be wither
C:\ or C:\Windows (or where you now did install it).
We assume you include the file
C:\apache\localhost\htdocs\includes\myinclude.php in your yourscript.php with
require_once('includes\myinclude.php');
This makes php (cli executed) to try to include C:\includes\myinclude.php
and not the C:\apache\localhost\htdocs\includes\myinclude.php which you want
to include. The best option is to use absolute paths, then the script will
work both in the web environment and in the cli environment.
//Aho
[Back to original message]
|