file_put_contents - failed to open stream: Permission denied

前端 未结 14 1700
耶瑟儿~
耶瑟儿~ 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:27

    Guys I had this problem for 1 month and did everything but couldn't fix it, but now I know the solution.

    I use a shared linux hosting, when my admin changed the php to 5.3 I got many error for the "file_put_contents" code. try to test my plan:

    In your host create a file like mytest.php, and put this code in and save:

    
    

    Open the URL "www.your-domain.com/mytest.php" one time and then check your email. you should have an email from your host with the information you entered in mytest.php, check the sender name. if its from Nobody you have problem about "Permission Denied" because something not defined and if the sender name is like my id: iietj8qy@hostname5.netly.net you dont have prob.

    My admin changed the server and installed the host again I think and the problem got solved, tell your host administration what I told you and maybe they find the answer.

    hope it helps you!

提交回复
热议问题