5

I'm attempting to use multiple paths for my php open_basedir config value, in php.ini on a windows server.

The line I'm using is:

open_basedir = E:/Websites;C:/PHP/includes/

Unfortunately, it's ignoring the second entry. Whenever I try to execute code in the C:/PHP/includes directory (this example happens to be PHPUnit), I get

PHP Warning: require(): open_basedir restriction in effect. File(C:\PHP\includes\PHPUnit\PHPUnit-3.6.10\PHPUnit\Autoload.php) is not within the allowed path(s) : (E:/Websites) in C:\PHP\includes\PHPUnit\PHPUnit-3.6.10\phpunit.php on line 41

Note, it's not even showing the second item in the paths list. Can anyone spot where I'm going wrong?

Am I right in thinking that semicolon (;) denotes a comment? If so, how do I separate the entries, as the manual doesn't make it clear

4

Don't forget put quotes " around whole path, and AFAIR windows is using different notation? try sth like that: open_basedir = "E:\Websites;C:\PHP\includes"

  • the quotes did it for me on windows server 2012 with php 5.4.14, thanks – Richard Nov 5 '13 at 15:19
2

I had the same problem.

Just use a simple colon : as a separator, then it works.

Note for clarity: "Under Windows, separate the directories with a semicolon. On all other systems, separate the directories with a colon." (from the php docs)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.