Question

I am using DOMDocument for creating and parsing xml files but when I use it in agavi framework it shows me this error :

( ! ) Warning: DOMDocument::save(mci_sitemap.xml) [domdocument.save]: failed to open stream: Permission denied in /home/sample6/tps/app/modules/Mci/models/PrcModel.class.php on line 531

and It doesn't let me to create my xml file

Was it helpful?

Solution

Your web server needs permission to write to the target directory. If you are running Apache, that user is usually named apache. If you are running IIS, the user name varies according to the server name; you can find it in your IIS management console.

You need to think about security before you give write permission to the web server user under the web root. Ideally, you should be writing your xml file outside the web root.

Agavi is not doing anything unusual, here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top