1

I'm running php 5.5.12 on Windows Server 2008 with IIS7 and FastCGI.

Here's one of the log errors I'm getting:

file_put_contents(): open_basedir restriction in effect. File(C:\Program Files (x86)\Wowza Media Systems\Wowza Streaming Engine 4.0.3\content\vod\test.smil) is not within the allowed path(s): (C:\Program Files (x86)\Wowza Media Systems\Wowza Streaming Engine 4.0.3\content\vod;C:\Windows\TEMP\;E:\webpage;C:\php) in E:\webpage\dev\vod\createsettings.php on line 41

Here's my open_basedir line in php.ini:

open_basedir = "C:\Program Files (x86)\Wowza Media Systems\Wowza Streaming Engine 4.0.3\content\vod;C:\Windows\TEMP\;E:\webpage;C:\php"

As you can see, the destination directory is in fact specified in open_basedir, but it's acting as if it's restricted.

Commenting out open_basedir and restarting IIS results in no error and everything works as expected.

Changing the destination directory to one of the other open directories (C:\Windows\TEMP, for example) also works fine with no errors.

I've read eight pages worth of issues here but haven't seen a match. Thanks in advance for any help you can offer!

acbaldwin
  • 15
  • 6
  • I should also add, although perhaps not actually related - if the destination file already exists, everything works with no error. – acbaldwin Dec 23 '14 at 19:22
  • You're going to run into a lot of permission issues trying to use PHP and C:\Program Files (x86). If you don't understand Windows permissions, I would recommend avoiding that directory when using PHP. – versalle88 Dec 23 '14 at 19:58
  • There's a good amount I don't understand about *all* of this, but I'm pretty comfy in Windows (at least I think) and effective permissions for the vod directory seem appropriate for IUSR. Would an NTFS permissions issue cause an open_basedir restriction error though? – acbaldwin Dec 23 '14 at 20:10
  • Yeah, I've had it throw this error as well as several other file/folder errors when permissions weren't properly set for the PHP user. That being said, I've added an answer that might fix the issue. – versalle88 Dec 23 '14 at 20:26
  • Decided to just move the destination directory up to C:\vod, everything works fine that way with no fuss. Not sure why php returns an open_basedir restriction error when in fact it may be NTFS permissions, but it does seem to be the case. If you submit your suggestion as an answer I'd be happy to mark it as such. Thanks! – acbaldwin Dec 23 '14 at 21:37
  • I'm glad you were able to get this working. I've updated my answer accordingly. Cheers. – versalle88 Dec 24 '14 at 13:49

1 Answers1

0

You're going to run into a lot of permission issues trying to use PHP and C:\Program Files (x86). Both the 32-bit and 64-bit Program Files directories in Windows are very picky when it comes to write permissions. If you move the directory outside of Program Files and right into the C:\ drive it should alleviate some problems. (i.e., C:\temp is usually easily accessible with PHP when doing file uploads, session storage, etc...).

versalle88
  • 1,139
  • 1
  • 7
  • 19
  • Tried that, same error. Left the backslash in, I know it's preferred. Thanks for the suggestion though! – acbaldwin Dec 23 '14 at 21:29