Issue
I am using Fedora 24 on VirtualBox to host a small PHP web app. I am trying to append text into a file that is in the same local directory as the PHP file (/var/www/html/). No matter what kind of permissions or ownerships I try to set onto the directory (html/) or the file I constantly get "Permission denied in /var/www/html/pdf.php on line 21" errors.
Is there any configuration settings in my php.ini file that I need to enable to allow editing of files? I've even tried setting the directory and file to chmod 777 just to see if it would give me access but even that is being rejected.
EDIT: I have also tried creating directories and files in other locations with the same results. I tried to have Apache run the mkdir and touch commands with the same results.
EDIT 2: At the request of the comment left to my initial question. Here is the ownership information for the target directory: ls -l /var/www/html/ drwxrwxr-x. 2 apache apache 4096 Nov 23 21:28 docs
The ownership information for the file: -rwxrwxr-x. 1 apache apache 1381 Nov 28 17:47 pdf.php
Solution
Try assigning to www-data:nobody
chown -R www-data:nobody *
, check apache group on your httpd.conf.
Verify /var/html perms to 775 at least.
Answered By - uruapanmexicansong Answer Checked By - Senaida (WPSolving Volunteer)