[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Upload error "open_basedir restriction"

Posted on 2007-07-21
9
Medium Priority
?
1,276 Views
Last Modified: 2008-01-09
I'm using Hosting Controller in Windows Server 2003 with IIS 6.0. I'm use a common upload script coded by PHP to upload some file to my server but it always notice that:
"Warning: copy() [function.copy]: open_basedir restriction in effect. File(C:\Program Files\PHP\tmp\php44.tmp) is not within the allowed path(s): (D:\quyvn\webphim\webphim.net) in D:\quyvn\webphim\webphim.net\www\UPLOAD2\index.php on line 192
[Water lilies.jpg] upload error"
Please tell me how to resolve this problem...
Thanks you all....
0
Comment
Question by:luckylukevn
  • 3
  • 2
  • 2
  • +2
9 Comments
 

Expert Comment

by:mafosil
ID: 19541756
I think you're trying to copy something to PHP temp folder (C:\Program Files\PHP\tmp\), but you're not allowed to do so. You can try changing PHP temp path in your php.ini to a folder within D:\quyvn\webphim\.(D:\quyvn\webphim\temp maybe)

It uses to happen when PHP safe mode is enabled in php.ini.
0
 

Author Comment

by:luckylukevn
ID: 19541841
I set the the Safemode in file php.ini is off and upload_tmp_dir = "C:\Program Files\PHP\tmp"
but it still notice this message again.
0
 
LVL 20

Expert Comment

by:Muhammad Wasif
ID: 19541869
Have you restarted IIS?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:luckylukevn
ID: 19541883
I never set the safemode on before. Do you have any idea about another place to config?
0
 
LVL 48

Expert Comment

by:hernst42
ID: 19542290
openbase_dir restriction is independet of safe_mode is on or off. With the current settings of openbase_dir your are only allowed to access files under D:\quyvn\webphim\webphim.net. So either add C:\Program Files\PHP\tmp to openbase_dir or change upload_tmp_dir to a path under D:\quyvn\webphim\webphim.net
0
 
LVL 8

Expert Comment

by:GEM100
ID: 19542340
Search for:
C:\Program Files\PHP\tmp\

in your script, and change it to:
D:\quyvn\webphim\webphim.net\www\tmp\

Make sure you create directory "tmp" in D:\quyvn\webphim\webphim.net\www\
0
 

Author Comment

by:luckylukevn
ID: 19544219
to GEM100:
If I change in my php.ini the value of upload_tmp_dir to
"D:\quyvn\webphim\webphim.net\www\tmp\"
ok, it works, but I have a lot of virtual directories else, for example
"D:\quyvn\quyvn\quyvn.net\"
So do you have any else solution?
0
 
LVL 8

Expert Comment

by:GEM100
ID: 19544395
Please try setting it to
upload_tmp_dir = NULL
and see if it works. I know solution for Apache with htaccess, but you are running on IIS...

Is your "open_basedir" currently set to anything in the php.ini file?
0
 
LVL 48

Accepted Solution

by:
hernst42 earned 1500 total points
ID: 19545466
See http://www.php.net/manual/en/configuration.changes.php#configuration.changes.windows how to changes ini-values with IIS like its done via a .htaccess
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.
Suggested Courses
Course of the Month17 days, 15 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question