0

I repeatedly get the following error when I try to save a processed document to a temp folder using php. (btw I running apache on my local machine)

"Warning: DOMDocument::save(/tmp/lecture.xml) [domdocument.save]: failed to open stream: Permission denied in /Users/JCWitt/WebPages/plaoul/text/textdisplay.php on line 278"

A couple of questions here:

1) When I tell the server to save the file in /tmp/ is it looking for a folder in the ServerRoot or the DocumentRoot?

2) Second can I do something in httpd.conf to give php permissions to save files? And can you tell me what I might add?

Thanks for your help.

Jeff
  • 3,943
  • 8
  • 45
  • 68
  • 'Permission denied' hints to access rights to the directory. Have you checked them? – Dirk McQuickly Oct 27 '12 at 16:04
  • sort of -- but things bring me to first question -- which directory? -- the tmp dir from the ServerRoot or the tmp dir from the DocumentRoot – Jeff Oct 27 '12 at 16:47
  • `/tmp/` is a relative path which will be relative to your current working directory. You can find out what that directory is with the `getcwd()` function. See http://php.net/manual/en/function.getcwd.php. But what do you mean by 'sort of' checking your folder permissions? – Dirk McQuickly Oct 27 '12 at 19:24

0 Answers0