writing new files on windows server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
csgonan
Forum Newbie
Posts: 4
Joined: Thu Aug 31, 2006 2:00 pm

writing new files on windows server

Post by csgonan »

This is my first stab at PHP. I'm porting an application from linux to Windows 2003. There was a php script that would not produce any output, although a php syntax check came clean. The script generates and XML file and writes it to a directory.

The file D:/www/Apache2/htdocs/webfile/blogroll/blogroll.xml is not writable

I am executing the php script in a bat file. This is the line that the generates the error.

writeFile($blogroll_rss, $rss_content);

The program runs fine on a linux machine. I looked at the permissions on the folder and its owned by administrators with full permissions and system also has full permissions.

Any suggestions?

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

post your code.
csgonan
Forum Newbie
Posts: 4
Joined: Thu Aug 31, 2006 2:00 pm

Post by csgonan »

I also made the file writable for the Users account and it didn't change.

Thanks for any help.
csgonan
Forum Newbie
Posts: 4
Joined: Thu Aug 31, 2006 2:00 pm

Post by csgonan »

I am hesitant to post the code because it is something we purchased. The script runs fine on linux. I am executing a .bat file that calls this

@D:\www\php5\php.exe -q D:\www\Apache2\htdocs\pulvermedia\blogroll\generator.php

from the windows CMD prompt.

If I click on the bat file I get the echo output but I don't get the error (but I still don't get the output of the XML file it created).

I put in a number of echo's to indicate where it was dying and here it is. I also don't get the echo output from the line after the writes.

// write the files
writeFile($blogroll_rss, $rss_content);
writeFile($blogroll_html, $html_content);

echo 'generator.php PPPP';
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Since you purchased it you should probably seek support from that company/individual first. We can't help you much with such small amounts of code as you've been posting. Additionally, the lines you have posted aren't referencing any built-in functions of PHP, nor do I see what specific error you are getting.

The only thing suggestable is checking the permissions of the files the error is talking about.
csgonan
Forum Newbie
Posts: 4
Joined: Thu Aug 31, 2006 2:00 pm

Post by csgonan »

ok. thanks.

I can't get support since we are porting it to Windows. The specific error I get is in the first email

The file D:/www/Apache2/htdocs/webfile/blogroll/blogroll.xml is not writable

When I execute the code at a CMD prompt that is the error. As I said, the directory is writable by users, system and Administrators. I put echos in up until that line to see where it is failing.

Thank you anyway.
Post Reply