Jump to content

failed to open a stream error - file_put_contents


Recommended Posts

when i try write content to a xml file using file_put_contents i am getting warning "failed to open stream: Permission denied" for a particular folder where my xml is created.

i am using php 5.2 version in iis7 in windows 2008 server. it works fine my windows xp with iis 6.

 

my code is

 

if (is_writable(_PS_MODULE_DIR_.$this->name.'/'))

{ $basedir =_PS_MODULE_DIR_;

$foldername= $this->name;

$filename = "$basedir$foldername/config.xml";

chmod($filename,0755);

file_put_contents($filename, utf8_encode($xml));

}

else

echo 'error'

 

folder has required permissions as specified in all other forums.

 

but it still not working.

 

any help please?

 

thanks,

ganesh

Link to comment
Share on other sites

×
×
  • Create New...