Why can't PHP script write a file on server 2008 via command line or task scheduler?
Posted
by rg89
on Server Fault
See other posts from Server Fault
or by rg89
Published on 2010-05-11T14:39:56Z
Indexed on
2010/05/11
14:44 UTC
Read the original article
Hit count: 407
I have a PHP script. It runs well when I use a browser. It writes an XML file in the same directory. The script takes ~60 seconds to run, and the resulting XML file is ~16 MB.
I am running PHP 5.2.13 via FastCGI on Server 2008 64 bit.
I created a task in task scheduler to run c:\php5\php.exe "D:\inetpub\tools\something.php"
No error returned, but no file created.
If I run this same path and argument at a command line it does not error and does not create the file.
I am doing a simple fopen fwrite fclose to save the contents of a php variable to a .xml file, and the file only gets created when the script is run through the browser.
Thanks
© Server Fault or respective owner