Jump to content

open_basedir restriction error


paulferree

Recommended Posts

I have an open source app thats throwing this error:

 

Warning: copy() [function.copy]: open_basedir restriction in effect. File(C:\Windows\Temp\php7318.tmp) is not within the allowed path(s): ([*path on server to specific account*])

 

The global open_basedir is set to no value (commented out) and when I run phpinfo on this account it is set to the specific site location on the server.

 

Safe mode is not on FYI

 

Why is it trying to write to a windows Temp folder instead of the local path?  How do I resolve this?

 

Thanks!

Paul

Link to comment
Share on other sites

Why is it trying to write to a windows Temp folder instead of the local path?

 

Because that's apparently where you're copying to/from. Check your code for a call to copy().

 

How do I resolve this?

 

Either stay within the paths specified in open_basedir, or turn it off.

Link to comment
Share on other sites

 

Because that's apparently where you're copying to/from. Check your code for a call to copy().

 

It's trying to copy from $_FILES["userfile"]["tmp_name"].  So it's the default temp directory.  How do I allow this script to access this temp directory?

 

Either stay within the paths specified in open_basedir, or turn it off.

 

open_basedir is turned off.  In the PHP.ini it's commented out.

 

 

Thanks

Link to comment
Share on other sites

For every domain on the server when I run phpinfo I see the local value is set to that particular sites root path on the server, but the global value shows no value.

 

So somewhere that value is being set for every domain, but I can't figure out where.  I looked at the link you provided but I still couldn't find it.  Any other ideas where to look?

Link to comment
Share on other sites

Ok, I've been running this around a bit.  I'm wondering how I would just go about changing the TEMP (or TMP) directory where the form is temporarily uploading the file  to fit within the boundaries of the open_basedir and avoid this altogether. And I'm sure it's the best security wise.

 

I'm on a Windows Server btw. 

 

Paul

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.