Reputation: 1
touch(): unable to create file /var/www/html/test.txt because Permission denied in /var/www/html/web_services/test.php on line 6.
The php script in question
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
echo exec("whoami");
touch("/var/www/html/test.txt");
?>
Development environment is rhel8. I have tried setting the ownership to apache:apache with.
sudo chown -R apache:apache www
I even tried with setting permissions as 777
to the entire www
directory recursively with
sudo chmod -R 777 www
Any thoughts are appreciated.
Upvotes: 0
Views: 483
Reputation: 357
Open terminal and type
sudo chmod a+wr /var/www/html
Type your password
You're done.
Upvotes: 0