Bug #74900 [NEW]: Random file not found on multiple processes

From: Date: Tue, 11 Jul 2017 12:32:21 +0000
Subject: Bug #74900 [NEW]: Random file not found on multiple processes
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209987@lists.php.net to get a copy of this message
From: falk dot aaron85 at gmail dot com Operating system: Windows Server 2012 R2 PHP version: Irrelevant Package: *Directory/Filesystem functions Bug Type: Bug Bug description:Random file not found on multiple processes 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 bug report at https://bugs.php.net/bug.php?id=74900&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74900&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74900&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74900&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74900&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74900&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74900&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74900&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74900&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74900&r=support Expected behavior: https://bugs.php.net/fix.php?id=74900&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74900&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74900&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74900&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74900&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74900&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74900&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74900&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74900&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74900&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74900&r=mysqlcfg

« previous php.bugs (#209987) next »