Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Php writing to file - empty?

Tags:

file

php

I've been struggling with writing a single string into a file. I'm using just a simple code under Slackware 13:

$fp = fopen('/my/absolute/path/data.txt', 'w');
fwrite($fp, 'just a testing string...');
fclose($fp);

The file gets created (if it's not already created) but it's empty ?! The directory in which this file is written is owned by apache's user & group (daemon.daemon) and has 0777 permissions. This has never happened to me before. I'm curious what's the reason I'm not able to write inside the file ?

Thanks in advance.

like image 994
tftd Avatar asked Dec 21 '22 18:12

tftd


1 Answers

Try $ df -h

It probably means your disk is full.

like image 122
Boris Guéry Avatar answered Dec 29 '22 11:12

Boris Guéry