thephpleague/flysystem · error · UnableToCopyFile

Unable to copy file from $source to $destination as this is

Error message

Unable to copy file from $source to $destination as this is a readonly adapter.

What it means

Error "Unable to copy file from $source to $destination as this is a readonly adapter." thrown in thephpleague/flysystem.

Source

Thrown at src/ReadOnly/ReadOnlyFilesystemAdapter.php:64

    public function createDirectory(string $path, Config $config): void
    {
        throw UnableToCreateDirectory::atLocation($path, 'This is a readonly adapter.');
    }

    public function setVisibility(string $path, string $visibility): void
    {
        throw UnableToSetVisibility::atLocation($path, 'This is a readonly adapter.');
    }

    public function move(string $source, string $destination, Config $config): void
    {
        throw new UnableToMoveFile("Unable to move file from $source to $destination as this is a readonly adapter.");
    }

    public function copy(string $source, string $destination, Config $config): void
    {
        throw new UnableToCopyFile("Unable to copy file from $source to $destination as this is a readonly adapter.");
    }

    public function publicUrl(string $path, Config $config): string
    {
        if ( ! $this->adapter instanceof PublicUrlGenerator) {
            throw UnableToGeneratePublicUrl::noGeneratorConfigured($path);
        }

        return $this->adapter->publicUrl($path, $config);
    }

    public function checksum(string $path, Config $config): string
    {
        if ($this->adapter instanceof ChecksumProvider) {
            return $this->adapter->checksum($path, $config);
        }

        return $this->calculateChecksumFromStream($path, $config);

View on GitHub (pinned to b277b5dc3d)

When it happens

Trigger: Thrown at src/ReadOnly/ReadOnlyFilesystemAdapter.php:64 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of thephpleague/flysystem@b277b5dc3d (2026-08-17). Data as JSON: /api/errors/1876216f6062ff60. Report an issue: GitHub.