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
https://forums.phpfreaks.com/topic/203690-open_basedir-restriction-error/
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.

 

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

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.

 

Apparently it isn't turned off if you are getting open_basedir restrictions.

 

Configuration settings can be set a number of different places: http://dk.php.net/manual/en/configuration.changes.modes.php

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?

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.