So I've recently switched over from shared hosting to vps hosting and starting a server from scrath. Transitioning has come with some troublesome problems that I can't find a solution for anywhere. I've been searching for the past couple days on and off but can't find any other solutions that match my exact criteria.
So. What I've got:
1. File permissions are not working how they used to. Before, all I had to do was set a file to 0640 and it would serve an HTTP 403 server code when viewing it in the browser, but could still be accessed through PHP. Now, If viewed in the browser, it issues a PHP error:
[13-Aug-2016 18:18:41 America/New_York] PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
[13-Aug-2016 18:18:41 America/New_York] PHP Fatal error: Unknown: Failed opening required '/var/www/html/inc/init.inc.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
As well as not being accessible through PHP (i.e. require()); same error. Now, that is with the owner/group of root root. If I create the file through FTP which gives an owner/group of root www-data it displays in the browser and is accessible through PHP with 0640??? Perhaps an ownership rights issue?
2. Fopen is failing when creating a file giving an error of:
[13-Aug-2016 18:31:12 America/New_York] PHP Warning: fopen(progress.txt): failed to open stream: Permission denied in /var/www/html/***/process.php on line 31
When creating a file through PHP, the owner/group is www-data www-data. The directory has 0755 perms and is still giving a permission denied prompt? Another ownership rights issue I'm suspecting.
Not looking for an all-out solution. Just any advice would be appreciated! I'm not sure about what information to provide.