file_put_contents - failed to open stream: Permission denied

前端 未结 14 1654
耶瑟儿~
耶瑟儿~ 2020-11-27 03:05

I am trying to write a query to a file for debugging. The file is in database/execute.php. The file I want to write to is database/queries.php.

14条回答
  •  时光取名叫无心
    2020-11-27 03:52

    Try adjusting the directory permissions.

    from a terminal, run chmod 777 database (from the directory that contains the database folder)

    apache and nobody will have access to this directory if it is chmodd'ed correctly.

    The other thing to do is echo "getcwd()". This will show you the current directory, and if this isn't '/something.../database/' then you'll need to change 'query.txt' to the full path for your server.

提交回复
热议问题