[Tfug] writing files from PHP
keith smith
klsmith2020 at yahoo.com
Wed Jun 18 09:56:24 MST 2008
That is a very good question. One I have been wrestling with for a while.
I have found several things to address this. I'm hoping others on the list will replay to this post.
The version of PHP is not relevant as far as I know. Most of the world is now running PHP5 or is in the process of upgrading.
I find changing the directory permissions to 777 and the file permissions to 666 allow for reading and writing a file using PHP.
Having a directory set to 777 is not secure and I think most will advise not to do this.
The solution might be to set the ownership of the directory and possibly it's contents to the same user as Apache. I seem to remember doing so on a project a year or so ago.
The only problem with changing directory ownerships (chmod) in a shared hosting environment you probably do not have permission to do so.
------------------------
Keith Smith
(520) 207-9877
PHP Programmer
--- On Tue, 6/17/08, Paul Scott <waterhorse at ultrasw.com> wrote:
From: Paul Scott <waterhorse at ultrasw.com>
Subject: [Tfug] writing files from PHP
To: "Tucson Free Unix Group" <tfug at tfug.org>
Date: Tuesday, June 17, 2008, 11:06 PM
Dumb question: With permissions 644 I can open and write files with
version 4.4.8 of PHP on a web server. With the same version of PHP
and the same file permissions I can't open the files for writing on
this Mac PPC or my home computer. The code uses fopen().
I haven't found any obvious options with phpinfo() that give me a clue.
TIA for any help,
Paul Scott
_______________________________________________
Tucson Free Unix Group - tfug at tfug.org
Subscription Options:
http://www.tfug.org/mailman/listinfo/tfug_tfug.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tfug.org/pipermail/tfug_tfug.org/attachments/20080618/86f28d86/attachment-0002.html>
More information about the tfug
mailing list