Bug #75384 [Com]: PHP seems incompatible with OneDrive files on demand

From: Date: Thu, 19 Oct 2017 17:43:55 +0000
Subject: Bug #75384 [Com]: PHP seems incompatible with OneDrive files on demand
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211786@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75384&edit=1

 ID:                 75384
 Comment by:         info at sillevl dot be
 Reported by:        phpbugs at dougweb dot org
 Summary:            PHP seems incompatible with OneDrive files on demand
 Status:             Open
 Type:               Bug
 Package:            *Directory/Filesystem functions
 Operating System:   Windows 10
 PHP Version:        7.1.10
 Block user comment: N
 Private report:     N

 New Comment:

I can confirm this issue. 

The problem exist after upgrading Windows fall creators update 1709. I have upgraded 2 PC's to
this version. On the first one, the Onedrive update (build 17.3.7073.1013) that supports the
"Files on Demand" feature , is installed. On the second one, Onedrive (build
17.3.6998.0830) does not support the "Files on Demand" feature. On both the problem
exists. This seems to suggest the cause of the problem is introduced by the Windows update, and is
not depending on the Onedrive version.
I can also confirm that the problem does not exist on files that are not in a Onedrive directory.


Previous Comments:
------------------------------------------------------------------------
[2017-10-15 18:01:52] phpbugs at dougweb dot org

Description:
------------
It would seem that the new "Files on Demand" feature of OneDrive in the Windows fall
update causes issues with PHP's ability to open files. In theory according to MS this should be
invisible to applications but there's definitely something screwy going on with PHP.

(https://support.office.com/en-us/article/Learn-about-OneDrive-Files-On-Demand-0e6860d3-d9f3-4971-b321-7092438fb38e?ui=en-US&rs=en-US&ad=US&fromAR=1).

Any attempt to iterate through files in a folder, or even simply do a "require" results in
PHP somehow not being able to see them. This applies even if the files are locally available on the
PC, the only thing needed to trigger this is to have Files on Demand enabled and to have the source
located somewhere within the OneDrive folder.

Moving the source code to any other folder makes things work normally. 

Weirdly, PHP does seem to be able to read the initial file it's asked to execute, it's
only secondary files it's unable to load.

This may or may not help debugging, but if I install Ubuntu into Windows 10 via the Windows Store,
and execute PHP scripts in the OneDrive folder from Linux (so PHP is using the Linux file APIs, with
the MS shim converting them to the Windows ones) then that works fine.


Test script:
---------------
1) On a recent Windows Insider Build (or wait until RTM in a few days)
2) Enable OneDrive, and the "Files on Demand" feature

Then in your OneDrive folder, create 2 files

Foo.php
<?php
require 'Bar.php';


Bar.php
<?php
echo 'Require worked';


Then run php Foo.php

Expected result:
----------------
See "Require worked" output to the screen

Actual result:
--------------
PHP Warning:  require(Bar.php): failed to open stream: No such file or directory
 in Foo.php on line 2

Warning: require(Bar.php): failed to open stream: No such file or directory in F
oo.php on line 2
PHP Fatal error:  require(): Failed opening required 'Bar.php' (include_path='.;
C:\php\pear') in Foo.php on line 2

Fatal error: require(): Failed opening required 'Bar.php' (include_path='.;C:\ph
p\pear') in Foo.php on line 2



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75384&edit=1


Thread (25 messages)

« previous php.bugs (#211786) next »