|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-01-14 08:32 UTC] the dot bitpoet at gmail dot com
Description:
------------
I've repeatedly and reproducibly experienced a problem with WinCache preventing the renaming of directories once a PHP script inside them has been accessed. This becomes apparent when trying to install the ProcessWire CMS (download from processwire.com, any release). In one of the last steps, the selected site profile folder ("site-blank", "site-basic", etc.) is renamed to "site" by the installer script that pulls information from the PHP scripts within each profile directory. Renaming the directory fails with a write error if WinCache is active. Without WinCache, the step completes fine.
I have encountered this with WinCache 1.3 and 2.0, with PHP versions 5.6 and 7.0, on different IIS versions, all using FastCGI and NTS builds.
I've found bug #5935 which sounds similar but should have been fixed a long time ago, so it might or might not be a regression.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 19:00:01 2025 UTC |
I've attempted to repro the problem with a minimal script, and so far, have been unable to repro the issue. With both WinCache enabled or disabled, the scripts below succeed Steps: 1. ren_foobar.php 2. read_tmp_simple.php 3. [repeat 1 & 2 ad infinitum] Scripts used to try and repro the problem: [ren_foobar.php] <?php $base_dir = sys_get_temp_dir() . '/banana'; if (!file_exists($base_dir)) { echo "Creating directory: " . $base_dir . " ..."; mkdir($base_dir); mkdir($base_dir . '/foo'); echo "Creating content..."; file_put_contents($base_dir . "/foo/zz.txt", "Example Text"); file_put_contents($base_dir . "/xx.txt", "Hello world!"); } echo "Renaming directory..."; if (file_exists($base_dir . "/foo")) { echo " /foo "; var_dump(rename($base_dir . "/foo", $base_dir ."/bar")); } else if (file_exists($base_dir . "/bar")) { echo " /bar "; var_dump(rename($base_dir . "/bar", $base_dir ."/foo")); } echo "Renaming file..."; if (file_exists($base_dir . "/xx.txt")) { echo " xx.txt -> yy.txt "; var_dump(rename($base_dir . "/xx.txt", $base_dir . "/yy.txt")); } else if (file_exists($base_dir . "/yy.txt")) { echo " yy.txt -> xx.txt "; var_dump(rename($base_dir . "/yy.txt", $base_dir . "/xx.txt")); } ?> [read_tmp_simple.php] <?php $base_dir = sys_get_temp_dir() . '/banana'; echo "Getting zz.txt.php..."; if (file_exists($base_dir . "/foo")) { echo $base_dir . "/foo"; var_dump(file_get_contents($base_dir . "/foo/zz.txt")); } else if (file_exists($base_dir . "/bar")) { echo $base_dir . "/bar"; var_dump(file_get_contents($base_dir . "/bar/zz.txt")); } if (file_exists($base_dir . "/xx.txt")) { echo "Getting xx.txt..."; var_dump(file_get_contents($base_dir . "/xx.txt")); } else if (file_exists($base_dir . "/yy.txt")) { echo "Getting yy.txt..."; var_dump(file_get_contents($base_dir . "/yy.txt")); } ?>