Qbasicnews.com

Full Version: PHP file permission question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Whenever I use the fopen() function in PHP on my PHP-enabled webserver, I get an error: Permission denied.
This isn't Tripod or Geocities - I paid for it. I just need to know: is it standard to disallow php pages from creating files on a webserver? If not, is there a file permission I can chmod to allow it to generate files?
CHMOD 777 the file you're trying to open.

Do that through your FTP proggie.
Excellent. Thanks. Big Grin
But won't that make the file completely open to everything, so another php proggie on another webserver could modify it?
And what if I want it created if it doesn't exist?
CHMOD the directory to 777 and the file (if it exists) to 666. If the file is executable (cgi, php, etc) then CHMOD the file to 777.

No script from another server will be able to modify the file (provided they don't have your password).
It's in the plain public_html directory, I don't know what the permissions are on that folder.
The file itself is CHMODed to 777. And it works.
Thanks. 8)
It's probably best you either use a database for your stuff or make up a directory for "writable files", so the rest of your site isn't in so much danger.
I didn't chmod my directory! I wouldn't want anyone to be able to mod that :wink:
But once my site is actually up, I'll probably split everything into seperate dirs.
BTW, Oracle, can you give me a few links for php resources: how to create dynamically generated images?
http://php.net/manual/en/ref.image.php

That's the official manual of image functions with PHP.

You wanna dynamic sig too? :lol:
How'd ya guess? :wink:
Actually, I've been designing The Geekery v2.0. I might want some dynamic image generation there.
Be careful: dynamic images can't be cached, leading to increased loading time.
Pages: 1 2 3