Re: Command line cannot fwrite, browser can

On 6/17/2011 5:22 PM, Adrienne Boswell wrote:
Okay, I give up! I pulled the very last hair out of my head, and now I
am asking for help.

This is a Win2003 SP2 server running Plesk PHP5 on Microsoft-IIS/6.0.
Why am I using PHP on Win? The main application was written in Classic
ASP, hence the Windows server. I need to run a script from the command
line so I can call it with the task manager to run every night.

Using the command line, the script gives a warning, and then fails saying
it cannot write to a file. Using a browser, the script works flawlessly.

I am thinking it might be a permission issue? I checked and IUSER the
DOMAIN USER, SYSTEM and Administrator have full permissions on the file
(s) in question. Is there another user I should be including? The batch
file is running as Administrator.

The other issue is that the file giving a warning IS on the server. All
the other files mentioned are found without a problem - and again this
only happens with the command line.

This is the error I am getting:
C:\Inetpub\vhosts\\httpdocs\groupmail>cd c:\parallels
C:\Parallels\Plesk\Additional\PleskPHP5>php.exe c:\inetpub\vhosts

Warning: file_get_contents(groupmail1_noname.txt): failed to open stream:
No such file or directory in C:\Inetpub\vhosts\\httpdocs
\groupmail\groupmail.php on line 88
cannot write to groupmail.html

<lots of other stuff snipped>

Classic windows permission issue. First of all, ensure you're writing to the file you think you are (i.e. use absolute paths, etc.). Then try a windows-related newsgroup.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.