file_put_contents permission denied
问题 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 . I am trying to use file_put_contents(\'queries.txt\', $query) But I am getting file_put_contents(queries.txt) [function.file-put-contents]: failed to open stream: Permission denied I have the queries.txt file chmod\'d to 777, what could the issue be? 回答1: Try adjusting the directory permissions. from a terminal, run chmod 777 database (from the