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

From: Date: Thu, 02 Nov 2017 17:41:49 +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-212411@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:         simbiat at bk dot ru
 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:

BTW, the same thing affects MySQL: Fatal error: Can't open and lock privilege tables: Table
storage engine for 'user' doesn't have this optionFor more information, see Help and
Support Center at http://www.mysql.com.


Previous Comments:
------------------------------------------------------------------------
[2017-11-02 17:35:10] simbiat at bk dot ru

I figured out why it was not working for me when I moved htdocs. It was moved by Windows in a way,
that Windows treated it as it was still in OneDrive. I ran

dir /AL c:\Users\username\

which is expected to show all "links" and it listed htdocs as "DIR". I moved it
away, created a directory manually and reran the command: htdocs was not there. In both cases
OneDrive was there as "DIR".
Note that /AL flag should NOT list "DIR". Meaning, that there is something different with
those OneDrive directories (obviously). I dunno how to see what exactly.

------------------------------------------------------------------------
[2017-11-02 04:21:04] simbiat at bk dot ru

I think this is not OneDrive related. I moved htdocs to 1 directory above OneDrive (that is
C:\users\username\htdocs) but still get the same error. When I move it to C:\htdocs - it works fine.
I think there is something wrong with permissions, that PHP gets from Apache, even though, Apache
can access the files normally. Tried setting php.exe to run under admin (Compatibility mode), but
that did not help, either.

Warning like
PHP Warning:  Unknown: failed to open stream: Operation not permitted in Unknown on line 0

Only support that PHP can't access the file. And the funny thing is: if I look at the folders
in Total Commander it shows them as... Links. And SymLink following is allowed in configuration
file.

------------------------------------------------------------------------
[2017-10-22 07:16:09] info at sillevl dot be

I have added a comment on github on the code that might be the source of the problem: https://github.com/php/php-src/commit/065edced71c7f15f32fc2fb483a9048328b8108e#commitcomment-25110205

------------------------------------------------------------------------
[2017-10-19 17:43:44] info at sillevl dot be

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.

------------------------------------------------------------------------
[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 (#212411) next »