Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

PHP Scripts and Creating Files

 
   Database Help (Home) -> PHP RSS
Next:  fs  
Author Message
Bryan Meyer

External


Since: Feb 22, 2005
Posts: 1



(Msg. 1) Posted: Tue Feb 22, 2005 6:47 pm
Post subject: PHP Scripts and Creating Files
Archived from groups: comp>lang>php (more info?)

Hello Everyone:

I have a PHP script that attempts to create a temporary file to be used
during processing. The script is owned by my username (bryanrme) on
the server. When the script attempts to create the temporary file, I
get a "failed to open stream: Permission denied" error. The
permissions on my directory are set to 755. When I set the permissions
to 757, the creation of the file is successful. In this case, I notice
that the script spawns a temporary file owned by a user named "99".

Is there any way to avoid this? I'd prefer not to leave my directory
set at 757, but is there any workaround for this? I checked my server
configuration and safe mode is not enabled. Any suggestions? I would
prefer that the script handle the creation, usage, and disposable of
the temporary file.

Thanks,
Bryan

 >> Stay informed about: PHP Scripts and Creating Files 
Back to top
Login to vote
gmuldoonnospam

External


Since: Jan 11, 2005
Posts: 4



(Msg. 2) Posted: Tue Feb 22, 2005 9:40 pm
Post subject: Re: PHP Scripts and Creating Files [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

says...

 > I have a PHP script that attempts to create a temporary file to be used
 > during processing. The script is owned by my username (bryanrme) on
 > the server. When the script attempts to create the temporary file, I
 > get a "failed to open stream: Permission denied" error. The
 > permissions on my directory are set to 755. When I set the permissions
 > to 757, the creation of the file is successful. In this case, I notice
 > that the script spawns a temporary file owned by a user named "99".
 >
 > Is there any way to avoid this? I'd prefer not to leave my directory
 > set at 757, but is there any workaround for this? I checked my server
 > configuration and safe mode is not enabled. Any suggestions? I would
 > prefer that the script handle the creation, usage, and disposable of
 > the temporary file.

(assuming you mean the script is run via a web interface and that this is
a Linux/Apache setup)

PHP runs scripts under the umbrella of the Apache user (looks like this is
user 99 in your setup) with the permissions/etc for that user.

Set up a user group with both (and only) yourself and the Apache user as
members. Set the directory's group ownership to this group (leave the
directory's personal ownership as yourself). Set directory permissions to
775.

Geoff M

 >> Stay informed about: PHP Scripts and Creating Files 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Creating .chm files on the fly - Is it possible to sreate .chm files on the fly, with content? I've searched the whole web and I can't seem to be able to find any extensions for this. Is there one out there someone could point me to? Or, would it be possible without an extension? Thank...

Creating Large zip files in php - Gday Guys I'm attempting to create zip files on the fly for some highly compressible, yet very large files stored on my Web server. At present I'm using a class from the Zend library by Eric Mueller which I've modified to suit my purposes. The proble...

Creating encrypted/password protected zip files. - Hi, I'm looking for a way to create encrypted and password protected zip files. I have just been coding the site http://webzipper.co.uk that creates zip files using the built in ZipArchive class but i dont know how to encript/pw protect the files and..

Creating a simple hitcounter for PHP web pages. (saves to .. - To make this work on a single page you will need to create/modify 4 files. So here goes... Create a file called counter.php and put following code in it: <?php //Counter $count_my_page = ("hitcounter.txt"); $hits = file($count_my_page); $hi...

Some php files in same directory of working files with sam.. -
   Database Help (Home) -> PHP All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]