October 22nd, 2000, 10:51 PM
I suspect this question has more to do with Linux than with PHP, but here it is: If a file already exists and I chmod 666 file_name then I can fopen("file_name","w") and everything works fine. But if a file doesn't exist and I try to create it with fopen("file_name","w") I get the 'permission denied' problem. I have PHP configured as an apache module so it runs under user:nobody, but even if I chown nobody.nobody directory, I can't get PHP to create new files. So, what do I need to do for this to work?
October 22nd, 2000, 11:14 PM
I usually have to make the directory permissions 777 in order to allow PHP to create or copy files to that directory. I havnen't found or heard of any other solution.
October 23rd, 2000, 02:26 AM
I chown the directory to the same user as my webserver, and chmod the directory to 755, and I can create file w/o any issues. Give it a whirl? If not, try 777. Be aware that this may open security issues for your web server, though.
October 24th, 2000, 12:04 PM
Hey, thanks. The chmod 777 did the trick.
October 26th, 2000, 12:38 PM
sorry, little question from a dummie.
i had the same problem and
i think the cwwesley solution is better to preserve security.
But how can i do to know the user as my webserver ?
October 26th, 2000, 01:48 PM
If you're running apache just look in the httpd.conf file. Chances are your server runs as user:nobody and group:nobody.
[This message has been edited by billyo (edited October 26, 2000).]