Having trouble writing to a file with PHP on Ubuntu

后端 未结 3 947
臣服心动
臣服心动 2020-12-15 11:50

I am running PHP 5.5.9 on Ubuntu 14.04. I\'m having trouble writing to a file. I feel like this has to be a file permissions problem because I\'m pretty sure the code is cor

3条回答
  •  情歌与酒
    2020-12-15 12:10

    Try giving the absolute path and the filename with open:

    $file = '/html/Projects/MD_ScrapingTool/files/filetest.txt';
    

    If the file does not exist, fopen should create the file with 'w' mode.

提交回复
热议问题