PHP open_basedir configuration ?

webbouk

Well-known member
The present setting for open_basedir within php.ini on my server is to allow access to all files (;open_basedir =)
I'm presuming that only applies from the root of the drive that php is installed in, ie in this case the C drive.
A quick check of the php_info file shows the setting to be: C:/Inetpub/vhosts/site_name\;C:\WINDOWS\Temp\

To give PHP access to a folder on the D drive in the same server would this be as simple as changing the line within php.ini to:

open_basedir = C:\Inetpub\vhosts\ ; D:\foldername

which would give PHP access to all websites within the C drive and the folder within D drive?
 
Yes that is how to do it. You can also create an ini file in the root of the website and set it there.
 
Unfortunately that didn't work.

PHP Info showed the C drive directory within the master value but not the D drive directory.
I played around with the spacing and the position of the semi-colon but to no avail, and putting it on a separate line resulted in PHP not being able to access either drive
 
Make sure it set like this.

PHP:
open_basedir = "C:\Inetpub\vhosts\;D:\foldername"

Notice the quotation marks.

If that doesn't work then create a user.ini file in the root directory and add that line in there.

Make sure
PHP:
user_ini.filename = ".user.ini"
is set in php.ini.
 
Top Bottom