Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is most easily reproduced by running PhpBackendUnitTest
, which fails on Windows resulting in a error similar to:
rename(sites/simpletest/454911/files/php/cache_page/.2182f2ee82,sites/simpletest/454911/files/php/cache_page/4DdMbToh62rmlatZJ9JZhKIsaANqRJmDb53GpRYrTfI/77b96f84dee112a2bc5cbb6c09722bee07bde3bd8bc78675274980ca21cf3378.php): Access is denied. (code: 5)
This is because rename()
on Windows incorrectly uses the target file permissions rather than the containing directory permissions. See this PHP bug report.
Comment | File | Size | Author |
---|---|---|---|
#14 | 2629240--local_history.patch | 1.55 KB | richard.lampitt |
#2 | 2629240-1.patch | 1.72 KB | mikeker |
Comments
Comment #2
mikeker CreditAttribution: mikeker as a volunteer commentedComment #3
xjmComment #14
richard.lampitt CreditAttribution: richard.lampitt at SIRUSS commentedUpdated the patch in #2 to work with Drupal 9.3
Comment #17
smustgrave CreditAttribution: smustgrave at Mobomo commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
This will need a test case to show the issue. Would recommend the #testing channel on slack for how to write a windows only test.
Comment #18
crutch CreditAttribution: crutch commentedExperiencing this now on local windows dev machine using XAMPP v3.3.0, D9.5.5, PHP 8.1. #14 isn't applying.
Scenario
When trying to generate video thumbnails using core media, I ran into an issue with the file system. After adding/using the video field "media_oembed_video" and saving, I edited the media item and changed the suggested file path which was public://oembed_thumbnails or public://oembed_thumbnails/videos to use a custom location. I then deleted the files and folders from the suggested locations above and in the styles directory expecting auto-regeneration of the folders and files. Now getting error...
Warning: rename(sites/default/files/php/twig/.r3Zx1jkE6kBEezw2NmPNEuratkI,sites/default/files/php/twig/641488bb00721_status-messages--alerts.h_kDfXO1DP-OaUrNTKHNGCTb_0Q/TcuRT0AQzFp7awBIpnkgIIYABxTnucXuVfQO6jOzM7I.php): Access is denied (code: 5) in Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage->save() (line 88 of C:\xampp\htdocs\web\core\lib\Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage.php)
references: https://www.drupal.org/project/drupal/issues/2700019, https://www.drupal.org/project/drupal/issues/2606772, https://www.drupal.org/project/drupal/issues/3214257#comment-14978745
Comment #19
Grabby CreditAttribution: Grabby as a volunteer commentedI’m running D9.5.10 (PHP 8.1.21) with Laragon on a Windows box and tried #14, but I’m still getting
Warning: rename(tmp//twig/.4zqGXfPLZK7G4mnjw2abMtYMKkU,tmp//twig/64d68a2a2a255___string_template__1e7a22_5NnBESfxNIwNCEGCXhF2pxNyN/hXVFktFf4R1YIAvzgQqXtx4ksD18LS7FG6vvGU5r9og.php): Access is denied (code: 5) in Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage->save() (line 105 of mysite\web\core\lib\Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage.php)
In my case it’s triggered by adding or configuring blocks in layout builder.