0
I have the following code in php
<?php
function logs($texto){
date_default_timezone_set('America/Sao_Paulo');
$hora = date("H:i:s");
$data = date("d-m-Y");
$log = fopen("log/".$data.".txt","a+");
$escreve = fwrite($log,$hora." - ".$texto. "\r\n");
fclose($log);
}
?>
I did the test on it in windows environment, works perfectly, however when I go to linux, the same stops recording the logs, not even creates the document. You must have some permission to do so?
the permission I have in the directory is this drwxr-Xr-x, in theory it should let me create a new file and edit it not?
– Willian Lima
No, you need to have write permission in the directory, unlike how you sent it only has read and run permission.
– fajuchem
ah, right, I’ll try here. Thank you
– Willian Lima
That’s right. Thank you!!
– Willian Lima