debugging scheduled task

I have a task scheduler that runs:
C:\php\php.exe -r C:\www\test.php

  $file = "C:\\php\\test.txt";
  $fp = fopen($file, "w+");
  $datetime = date("r");

  fwrite($fp, "this is a test.\r\n");

  for($i = 0; $i < 10; $i++)
    $j = $i * $i;
    fwrite($fp, "$i squared is $j.\r\n");

  fwrite($fp, "the time is: $datetime\r\n");
  fwrite($fp, "test complete.");

When the time hits, I see the command prompt flash...but the file does not get written. Is there anyway to see the output? I'm not seeing anything in event viewer.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

you should be using the -f flag instead of the -r flag, the -r flag runs some code you enter, the -f flag runs the given file, so change it to the following and it should work:-

C:\php\php.exe -f C:\www\test.php

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jstretchAuthor Commented:
Sorry for the delay, been on the road.

Tried the -f flag, still the same results..nothing. No way of seeing the code or any errors?
jstretchAuthor Commented:
I tried:

"C:\Program Files\Internet Explorer\IEXPLORE.EXE" "http:\\localhost:8080\test.php"

and it worked, but opened a browser window, which I dont want because it will eat up memory. Is this a permission issue?
jstretchAuthor Commented:
Was a permission issue, the -f also helped. Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.