PHP File_put_contents not working

后端 未结 2 1429
南旧
南旧 2020-12-22 11:23

Check this code:



        
相关标签:
2条回答
  • 2020-12-22 11:55

    You can't write a remote file via http.(If you could do that, every one else could change that file also.)

    You need to use the local path.

    0 讨论(0)
  • 2020-12-22 12:08

    try changing directory properties

    chown www-data:www-data <dirname>
    

    and/or write as follows, if you host on linux

    <?php
    $var ="hi";
    shell_exec('echo "'.$var.'">>log.txt');
    ?>
    
    0 讨论(0)
提交回复
热议问题