views:

349

answers:

3

im running on windows xp and i am an administrator,
im using the latest xampp bundle available from their site and i receive these kinds of errors when i use file manipulation functions on php...

Warning: chmod() [function.chmod]: Permission denied in...
Warning: opendir(/feeds) [function.opendir]: failed to open dir: Permission denied in



do i need to set any environment variables for apache before i can use these functions?
but i think the problem lies only on my folder access permissions, but if so,
how do i set a folder's accessibility properties on windows?

+1  A: 

Does your php worker process have the necessary permissions?

Make sure whatever user the process is running as has proper permissions for the directory it is puking on.

right click on the folder, permissions...

Chris Ballance
uhm windows xp doesnt have that options when i right click on a folder
lock
A: 

You can try setting the umask as well before the chmod like so;

$old_mask = umask(0);
chmod('/path/to/file', 0755);
umask($old_mask);

More information on umask can be found at PHP's Manual

Steven Surowiec
+1  A: 

it appears that my script referred to an inexistent directory as i just specified $dir='/feeds';

it works fine on my machine in our office but i wonder why with the same configurations here on my pc at home it doesnt

as reference for other people who might have the same problem in the future my answer would be

check and make sure you are pointing your script to the right file :)

lock