Skip to content
Advertisement

How to give apache permission to write to home directory?

My server is in /var/www/html I have a php script in /var/www/html/fileio_test/io_test.php

JavaScript

When I try to run this script I get

JavaScript

How do I let apache write to my home directory? The server runs on fedora 20.

Advertisement

Answer

As your file residing in your Home directory, I would suggest one of following approaches.

  1. Give 0777 permission to file itself.

    JavaScript
  2. Change Ownership to apache user www-data and give owner-write permission.

    JavaScript
  3. Add your user to www-data group or vice-verse add www-data user to your group. And then group write permission.

    JavaScript

NOTE : I am assuming apache user name & group name is www-data & www-data respectively. You must change accordingly your server apache username/group name.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement