0

I'm running php 5.3.8, on xampp (the newest version, 1.7.7 I believe), on Windows7 64bit. When I try to construct a SplFileObject giving it a directory path I get following message (both in read, or write mode):

failed to open stream: Permission denied

The folder exists, and I set proper rights (remember I'm on the Windows, not Linux). Can it be a problem with xampp - for example windows don't allow apache process to write anywhere on disk?

marek
  • 259
  • 8
  • 19
  • yes, that is likely the issue. – Gordon Sep 28 '11 at 13:53
  • But I also try to read the folder, and still get that message... – marek Sep 28 '11 at 13:56
  • 1
    Maybe the apache process is not even allowed to read from there? Check under which user your script is running and compare it with the access rights allowed in the file-system. – hakre Sep 28 '11 at 13:59
  • 1
    Perhaps you could get more information on the user running apache with this function : http://fr2.php.net/manual/en/function.get-current-user.php – greg0ire Sep 28 '11 at 14:01
  • get_current_user() gave me the name of my user, so I guess it's ok - I can create folders (also read ;) ) – marek Sep 28 '11 at 14:08
  • @Hakre, how can I check my access rights (just to be sure if I really can read/write :]) – marek Sep 28 '11 at 14:09
  • @marek: Please consult the manual of your operating system for that, I'm not firm with Windows 7. I think it's some right-click on a directory, selecting *Properties* and then some more clicks. – hakre Sep 28 '11 at 14:12
  • There's a full control set for all users on all subfolders under my xampp directory. – marek Sep 28 '11 at 14:22
  • I tried to check whether a folder is writable with is_writable function, and it returned true, although I still have no clue why SplFileObject throws an exception... – marek Sep 29 '11 at 21:24

0 Answers0