Bug #76947 [Opn]: file_put_contents() blocks the directory of the file (__DIR__)
| From: | bugzilla77 at gmail dot com | Date: | Sun, 30 Sep 2018 18:19:21 +0000 |
| Subject: | Bug #76947 [Opn]: file_put_contents() blocks the directory of the file (__DIR__) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-217329@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76947&edit=1
ID: 76947
User updated by: bugzilla77 at gmail dot com
Reported by: bugzilla77 at gmail dot com
Summary: file_put_contents() blocks the directory of the file
(__DIR__)
Status: Open
Type: Bug
Package: *General Issues
Operating System: Windows 10 Pro 1803
PHP Version: 7.3.0RC2
Block user comment: N
Private report: N
New Comment:
>> Are you sure the problem is not that you have PHP running as a different user, and the
>> created file has ownership/permissions set that you cannot remove it and thus cannot delete its
>> parent directory?
File can be deleted. Only directory is blocked.
Previous Comments:
------------------------------------------------------------------------
[2018-09-30 18:02:30] bugzilla77 at gmail dot com
>> You say regression.
PHP 7.2 OK
PHP 7.3 bug
------------------------------------------------------------------------
[2018-09-30 17:58:18] bugzilla77 at gmail dot com
Full instruction
----------------
1. Install Windows 10 1803 Pro
2. Disable UAC, firewall and restart
3. Download http://nethium.idsl.pl/dir_block.zip
4. Unpack dir_block.zip directly to c:\
5. Start Nginx:
c:\nginx_start.bat
6. Start PHP 7.2.10
c:\php72_start.bat
7. Open Microsoft Edge and go to:
http://localhost/
8. You should see
7.2.10
9. Try to delete directory:
c:\nginx\html
10. YES, YOU CAN
11. Restore deleted directory from dir_block.zip:
c:\nginx\html
12. Stop PHP 7.2.10
c:\php7x_stop.bat
13. Start PHP 7.3RC2
c:\php73_start.bat
14. Open Microsoft Edge and go to:
http://localhost/
15. You should see
7.3RC2
16. Try to delete directory:
c:\nginx\html
17. UPS, YOU CAN NOT!!!
------------------------------------------------------------------------
[2018-09-29 18:01:16] requinix@php.net
You say regression. Was this reported as a bug and fixed in the past?
Are you sure the problem is not that you have PHP running as a different user, and the created file
has ownership/permissions set that you cannot remove it and thus cannot delete its parent directory?
------------------------------------------------------------------------
[2018-09-29 10:39:52] bugzilla77 at gmail dot com
Description:
------------
file_put_contents() blocks the directory of the file (__DIR__)
This is PHP 7.3 beta and RC regression.
There is no problem with PHP 7.2.x.
1. Create file using file_put_contents()
2. Now, you can NOT remove the directory of the file (__DIR__).
It happens only when FastCGI using.
Test script:
---------------
<?php
// Windows 10 Pro 1803
// PHP 7.3RC2 NTS 64 bit
// Only FastCGI problem
// BUG: file_put_contents() blocks the directory of the file (__DIR__)
file_put_contents('temp.txt','');
// Now, try to remove manualy the directory of the file (__DIR__ with content)
// PHP 7.3.RC2 - you can not!
// PHP 7.2.10 - you can
?>
Expected result:
----------------
I can remove the directory of the file (__DIR__).
Actual result:
--------------
I can NOT remove the directory of the file (__DIR__).
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76947&edit=1