PHP - write to file

I am executing this php script in WAMP and it is executing correctly from my localhost

<?php
    $file = fopen('../logs/appels_interface.log', 'a');
    fputs($file, "TEST");
    fclose($file); 
?>

When deploying my script (changing the path to / var / www / dreamteam / logs / appels _interface.log) on ​​my DEBIAN server and when calling it from an external file URL, the file is not created ...

Please, help

+3
source share
1 answer

Ensure that the /var/www/dreamteam/logs/log file (if one exists) can be overwritten by Apache. If you have access to SSH, log in and use chmodand / or chownon the command line. Otherwise, you may need to do this using a graphical FTP client.

, . 0777. , Apache , , . , . 0700 0500 .

+4

All Articles