Skip to content

Copy() target is blank in PHP 8.3.0 #12899

Open
@fredericch

Description

@fredericch

Description

The following code:

<?php
$source = '/media/sf_source/text.txt';
$destination = '/media/sf_destination/text.txt';
copy($source, $destination);

Resulted in this output:
/media/sf_destination/text.txt is an empty 0 bytes file.

How to replicate

php is running in the guest and tries to copy a file from a shared folder to an other shared folder.
Permissions are ok on the source and destination.
I tried to activate/disable the option "Host Input/Output Caching" of VirtualBox. There is no visible impact.

Environnement

Host: Windows 10 running VirtualBox 7.0.12
Guest: Ubuntu 20.04.

Workaround

<?php
file_put_contents('/media/sf_destination/text.txt', file_get_contents('/media/sf_source/text.txt'));

Related?

#9656
#9653

PHP Version

PHP 8.3.0

Operating System

Ubuntu 20.04 + Windows 10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions