Search code examples
phpazurefwriteubuntu-18.04mounted-volumes

Php, can not write to file


Each time I run it the file.txt is 0kb

  • Permission for that file is 777 owner www-data:www-data
  • The /var/www/html is on an external HD mounted to the server.
  • Server is Ubuntu 18.04
  • Azure hosted
  • PHP 7.2.19
  • Apache 2

I have this code

<?php
    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);
    $file = 'file.txt';
    $mf = fopen($file, 'w');
    fwrite($mf, 'hi-----');
    fclose($mf);
    echo $file;
?>

Solution

  • Turned out that my disk ran out of space and the file was not being written