Hello, I am a PHP newbie and I have created a script to write some text to a file. It has been giving me this error
Warning: fopen(./category.xml): failed to open stream: Permission denied in c:\inetpub\wwwroot\PHP_Fusebox\csc513\act_generateXML.php on line 16
Cannot open file
Here is the code example
$myfilename = "./category.xml";
if (!($fp=fopen("$myfilename","w"))) die("Cannot open file");
if(!(fwrite($fp,"Hello world"))) die("Error in writing");
fclose($fp);
Any help is appreciated
PHP - Writing to file (UNIX and Windows)
Moderator: General Moderators
Win XP solution : failed to open stream: Permission denied
hello,
I had a similar problem with writing to a file in Windows XP. I found the answer at Microsoft's knowledgebase. See following link:
http://support.microsoft.com/default.as ... -US;307874
The information in this article applies to:
Microsoft Windows XP Professional
Microsoft Windows XP 64-Bit Edition
How to Disable Simple File Sharing
1.Click Start, and then click My Computer.
2.On the Tools menu, click Folder Options, and then click the View tab.
3.In the Advanced Settings section, clear the Use simple file sharing (Recommended) check box.
4.Click OK.
cheers,
Sam
http://www.imagoscape.com
I had a similar problem with writing to a file in Windows XP. I found the answer at Microsoft's knowledgebase. See following link:
http://support.microsoft.com/default.as ... -US;307874
The information in this article applies to:
Microsoft Windows XP Professional
Microsoft Windows XP 64-Bit Edition
How to Disable Simple File Sharing
1.Click Start, and then click My Computer.
2.On the Tools menu, click Folder Options, and then click the View tab.
3.In the Advanced Settings section, clear the Use simple file sharing (Recommended) check box.
4.Click OK.
cheers,
Sam
http://www.imagoscape.com