Bug #74900 [Fbk->Opn]: Random file not found on multiple processes
| From: | falk dot aaron85 at gmail dot com | Date: | Wed, 12 Jul 2017 16:01:33 +0000 |
| Subject: | Bug #74900 [Fbk->Opn]: Random file not found on multiple processes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210019@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74900&edit=1
ID: 74900
User updated by: falk dot aaron85 at gmail dot com
Reported by: falk dot aaron85 at gmail dot com
Summary: Random file not found on multiple processes
-Status: Feedback
+Status: Open
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Windows Server 2012 R2
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
No, i use a absolute path like C:/file.zip.
The path in the script.is an absolute path for unix systems.
I am able fto reproduce the problem on windows systems with different php versions. You could maybe
try to increase the size of the for loop and the amount of php processes started in parallel.
Previous Comments:
------------------------------------------------------------------------
[2017-07-12 15:57:52] ab@php.net
Thanks for the report. I don't reproduce this locally using your PS script. Also, from the PHP
supplied - if a path like /path/to/file.zi is used, that might be the issue. If such a path indeed
is used, please switch to an absolute path and try again.
Thanks.
------------------------------------------------------------------------
[2017-07-11 12:32:16] falk dot aaron85 at gmail dot com
Description:
------------
I'm using php 7.0.9NTSx64 on a IIS 8.5 (Windows 2012 R2) to provide a TYPO3 website.
Unfortunately, randomly occurs a "No such file or directory" error on calling
file_get_contents() for a local static file (e.g. svg images).
Before the file_get_contents() call a file_exists() call is executed to verify that the file exists
and it does indeed:
I can reproduce the error by clearing the backend caches of TYPO3 and then opening 40 tabs of the
List menu.
In the frontend the error occurs randomly, maybe when multiple clients are using the website, but i
cannot reproduce it.
Another strange thing is, that when i clear the application pool on IIS, the error will not occur
for a few hours.
I already tried to use different PHP versions (5.x-7.x with and without fastCGI), disabling symbolic
links, ... but nothing resolved the problem.
The error only occurs under Windows machines, not under Linux or MacOS. You're also able to
reproduce it in shell.
Test script:
---------------
1..5 | ForEach-Object { Start-Job { c:\phptest\php-ts\php.exe -f c:\phptest\test.php } } | Out-Null
Get-Job | Receive-Job
Get-Job | Remove-Job -Force
<?php
ini_set('display_errors', 1);
error_reporting( E_ALL );
$path = '/path/to/file.zip';
for ($i = 0; $i < 100; $i++) {
echo "File Exists" . PHP_EOL;
var_dump(file_exists($path));
echo "FileSize".PHP_EOL;
var_dump(filesize($path));
echo "RealPath".PHP_EOL;
var_dump(realpath($path));
echo "FileGetContents".PHP_EOL;
var_dump(strlen(file_get_contents($path)));
echo "Fopen".PHP_EOL;
var_dump(fopen($path, 'rb'));
echo PHP_EOL . PHP_EOL;
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74900&edit=1