Write of %zu bytes failed with ``errno=%d %s

Description

The errno=22 happens when the path is an invalid path. It may hold forbidden characters, such as colon : or space ' '.

Example

<?php

file_put_contents($path, $content);

?>

Literal Examples

  • Write of 200 bytes failed with errno=22

Solutions

  • Check the path of the file.