Page 1 of 1

permission denied using fopen in php

Posted: Thu Jul 06, 2006 10:09 am
by issamo
hello I got this problem when I try to open a file in php:

Warning: fopen("CertificationsData.csv", "w") - Permission denied in /data/home/issam/public_html/OpenCertTable.php on line 413

I already chmod 755 all the files under and including my public_html directory. the intersting thing that I tried doing a chmod inside my php script and it gives me this intersting error:

Warning: chmod failed: Operation not permitted in /data/home/issam/public_html/OpenCertTable.php on line 411

do I have to change some configurations in my php..if yes can anyone tell me how?...

are there any other permissions I need to set?

thanks alot for your help.......btw I tried searching on the net didnt find any useful info to help me out too..:(

Posted: Thu Jul 06, 2006 10:29 am
by Jenk
It's a user privileges problem, namely with the user ID that the PHP process executes under.

This can only be resolved by the host, speak to them. :)

Posted: Thu Jul 06, 2006 10:33 am
by issamo
hi man..thanks for ur reply...actually I have the appache server so I think I can configure it somehow...do you know how can I allow my user ID is allowed to do such a thing?..what commands I need to use plz?

thanks in advance

Posted: Thu Jul 06, 2006 11:27 am
by Jenk
Guessing it's Linux?

It's not apache, but the actual OS privileges that need changing for the user that runs apache and php.

Posted: Thu Jul 06, 2006 12:57 pm
by issamo
found the solution I will put it here for others:

solution:
"permissions for non-executable file should be 644 or 664 or 666 (rw-rw-rw). Permissions for executable files or directories are the ones that need 755 or 775 or 777 (rwx-rwx-rwx) perms."..so I did chmod 666 and it worked..:)