Create / Edit a file on the server (Apache)

0

With the following code I would like to create a file on the server.

<?php
    date_default_timezone_set('America/Sao_Paulo');
    $nomeArquivoLogDia = date('Ymd') . '-teste.log';

    if (file_exists($nomeArquivoLogDia)) {
        $arquivoLog = file($nomeArquivoLogDia, FILE_SKIP_EMPTY_LINES);    
    } else {
        $arquivoLog = fopen($nomeArquivoLogDia, "w+");
    }
?>

When I run php ( link ) the file is not generated.

Does anyone know how to do this?

    
asked by anonymous 26.05.2017 / 03:53

1 answer

1

Normally this type of error is permission ... But to be sure, look for the error log of your host / server ...

If you have access to the machine and it is * nix, you can run cat /var/log/server_que_tu_usar/error.log

    
29.05.2017 / 03:52