PHP fopen() can't create or update log file (ubuntu) -


i give chmod 777 logs folder doesn't work ... have create log file day day . doesn't create file ... why ?

<?php $server = $_server['remote_addr']; $today = date("d-m-y"); $timest = date("d-m-y h:i:s"); $file = "logs/" . $today . ".txt"; $succ = $_session['logged'];  if (file_exists($file))     {     $add = file_get_contents($file);     $add . = "\nserver : " . $server . "\t username : " . $username . "\t timestamp : " . $timest . "\t success : " . $succ;     file_put_contents($file, $add);     }   else     {     $fc = fopen($file, "w") or die("unable open file");     $txt = "\nserver : " . $server . "\t username : " . $username . "\t timestamp : " . $timest . "\t success : " . $succ;     fwrite($fc, $txt);     fclose($fc);     }  ?> 


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -