Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject:
PostPosted: Wed Dec 10, 2008 7:32 pm 
Offline
Senior Member

Joined: Mon Sep 01, 2008 5:14 pm
Posts: 92
mjrich wrote:
Surely you jest ? Oi ?

(Non ? open_basedir is doing exactly as per the comments in php.ini. Either you'lll need to change your script so that it operates within the the aforementioned path, /var/www/html, or change the open_basedir path to fit your script.)


Thanks dood!


You are the MAN!


Top
   
 Post subject:
PostPosted: Thu Dec 11, 2008 3:41 pm 
Offline
Senior Newbie

Joined: Sat Jan 19, 2008 8:37 pm
Posts: 19
i would recommend
Code:
open_basedir = /tmp
probably, i can't think why would want your scripts modifying files in /var/www


Top
   
 Post subject:
PostPosted: Thu Dec 11, 2008 4:49 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
cz9qvh wrote:
i would recommend
Code:
open_basedir = /tmp
probably, i can't think why would want your scripts modifying files in /var/www


The OP said he was using a file upload script. In that case, the path where the uploaded files are saved must be writable by the script. And no sane script permanently saves files to /tmp.

I ran into exactly the same problem just a few days ago, due to a stupid mistake. I was making a very restrictive list of open_basedir directives and forgot to include /tmp. I only found out about the mistake when a user emailed me that uploads were not working.

PHP stores user-uploaded files in /tmp for a brief period, usually until the script which handles the upload exits or else the file is moved to a permanent location, whichever happens first. You can change this behavior by editing the "upload_tmp_dir" directive in your php.ini. Most of the time it's okay to use /tmp to store non-confidential information such as uploaded images. But if the information you're storing in /tmp is confidential and other people also have access to /tmp, you might want to think more carefully.

Another situation where it might be a good idea to change "upload_tmp_dir" is if you accept large uploads (~100M) and /tmp is in a different partition from the location of permanent storage (usually under the web root). In that case, you can avoid unnecessary inter-partition file moves (more copying = more I/O) by forcing PHP to store temporary uploaded files in the same partition as the location of permanent storage.


Top
   
 Post subject:
PostPosted: Thu Dec 11, 2008 7:02 pm 
Offline
Senior Member

Joined: Mon Sep 01, 2008 5:14 pm
Posts: 92
Ive got it working...thanks guys


Top
   
 Post subject:
PostPosted: Fri Dec 12, 2008 12:24 pm 
Offline
Senior Newbie

Joined: Sat Jan 19, 2008 8:37 pm
Posts: 19
hybinet wrote:
cz9qvh wrote:
i would recommend
Code:
open_basedir = /tmp
probably, i can't think why would want your scripts modifying files in /var/www


The OP said he was using a file upload script. In that case, the path where the uploaded files are saved must be writable by the script. And no sane script permanently saves files to /tmp.

I ran into exactly the same problem just a few days ago, due to a stupid mistake. I was making a very restrictive list of open_basedir directives and forgot to include /tmp. I only found out about the mistake when a user emailed me that uploads were not working.

PHP stores user-uploaded files in /tmp for a brief period, usually until the script which handles the upload exits or else the file is moved to a permanent location, whichever happens first. You can change this behavior by editing the "upload_tmp_dir" directive in your php.ini. Most of the time it's okay to use /tmp to store non-confidential information such as uploaded images. But if the information you're storing in /tmp is confidential and other people also have access to /tmp, you might want to think more carefully.

Another situation where it might be a good idea to change "upload_tmp_dir" is if you accept large uploads (~100M) and /tmp is in a different partition from the location of permanent storage (usually under the web root). In that case, you can avoid unnecessary inter-partition file moves (more copying = more I/O) by forcing PHP to store temporary uploaded files in the same partition as the location of permanent storage.
Oh, i suppose i assumed whatever he was uploading was going into a mysql database, instead of onto the filesystem. it didn't occur to me that open_basedir could be used to specify more than one location.


Top
   
 Post subject:
PostPosted: Fri Mar 27, 2009 4:16 pm 
Offline
Senior Newbie
User avatar

Joined: Mon Jan 26, 2009 3:06 pm
Posts: 5
Website: http://developer.notserp.com
Location: Berlin, Germany
sweh wrote:
Do you have SELinux enabled? This is a common problem with CentOS and SELinux when changing where the web server document root is. Google around.


I was under the impression that no Linode has SELinux enabled because by default all the linode kernels do not have it turned on.

I guess you just hate SELinux alot.


Top
   
 Post subject:
PostPosted: Fri Mar 27, 2009 5:56 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
notserpe wrote:
sweh wrote:
Do you have SELinux enabled? This is a common problem with CentOS and SELinux when changing where the web server document root is. Google around.


I was under the impression that no Linode has SELinux enabled because by default all the linode kernels do not have it turned on.

I guess you just hate SELinux alot.


Pointing out a problem people have with a technology is hating it? Huh...

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group