I know this is a common bug with many threads but I'm tired of searching and I still haven't solved it. When I try to run the function file_put_contents I get the following error:
Warning: file_put_contents(test.txt): failed to open stream: Permission denied in /var/www/html/nurses/adminWriter.php on line 29
I've already done the most common answer, change the permissions of the nurses folder and the test.txt file to 777. That didn't work.
I'm currently on a fresh install of the latest CentOS 7 server.
I've found that if I run the php script through the console:
# php /var/www/html/nurses/adminWriter.php
It works just fine, I get the error only when running it through the browser, but I really need to run it this way.
Best Regards!
file_put_contents(__DIR__ . '/test.txt');
'/var/www/html/nurses/'.'teste.txt'