Sanderse Posted April 22, 2018 Share Posted April 22, 2018 Hi, I have a PHP background job, running daily via Task Scheduler (Windows server). So far, it works. I have the following directories: A with subdir A2 B with subdir B2 Suppose the php file is in directory A. The php contains several include statements. This works as long as the file to be included is in the same directory as the job itself or in subdirectory A2: include ("subjob.php") and include ("A2/subjob.php") However, I want to include files from dir B or B2 But include ("../B/subjob.php") refuses to work. The strange thing is that in interactive jobs this all works without any problem (of course). In the scheduled situation, the "downstream addressing" to A2 works, but the "upstream addressing" does not. Any help will be appreciated. Regards, Jack Quote Link to comment Share on other sites More sharing options...
requinix Posted April 22, 2018 Share Posted April 22, 2018 But include ("../B/subjob.php") refuses to work.It should. Do you think that maybe telling us an error message would be helpful? Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted April 24, 2018 Share Posted April 24, 2018 You could do a batch file that runs the php cd c:\path\to\your\php\file php yourphpfile.php save that as whatever.bat then run whatever.bat with your scheduled task, that should take care of the relative paths Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.