[SOLVED] Owner/group permission issues in public_html
We are experiencing errors such as "directory does not exist, or has no write permissions" or "Permission denied in /home/adminuser/public_html/system..." or "Permission denied in /home/adminuser/storage/logs...".
is set to 0750. The others should be 0755 for folders inside
and 0644 for files. In order to bypass 'directory does not exist' or 'permission denied' errors, we have temporarily set some folders such as '
' to 0777, which presents a big security risk. Does anyone have suggestions? Are there issues with the folder ownership settings?
/public_html/
drwxr-x--- 18 adminuser nobody 4096 Apr 27 09:59 public_html
drwxr-xr-x 9 adminuser adminuser 4096 Apr 21 11:18 system
/storage/ (located outside public_html)
drwxr-xr-x 12 adminuser adminuser 4096 Mar 31 15:13 storage
drwxrwxrwx 2 adminuser adminuser 4096 Apr 27 10:42 logs
public_htmlis set to 0750. The others should be 0755 for folders inside
public_htmland 0644 for files. In order to bypass 'directory does not exist' or 'permission denied' errors, we have temporarily set some folders such as '
logs' to 0777, which presents a big security risk. Does anyone have suggestions? Are there issues with the folder ownership settings?
DEFAULT PHP: ea-php74
ea-php74 SAPI: dso-
It's going to be pretty hard to answer you within knowing what scripting language you are using. If it's PHP, we'd need to know what PHP handler you are using. 0 -
It's going to be pretty hard to answer you within knowing what scripting language you are using. If it's PHP, we'd need to know what PHP handler you are using.
[~]# /usr/local/cpanel/bin/rebuild_phpconf --current DEFAULT PHP: ea-php74 ea-php74 SAPI: dso0 -
I use suPHP on my personal box with WordPress and PHP sites to avoid any permissions issues like this, so that's what I'd recommend. 0 -
I use suPHP on my personal box with WordPress and PHP sites to avoid any permissions issues like this, so that's what I'd recommend.
Thank you for the suggestion! suPHP seemed to clear up a lot of the permission issues. Still seeing this one... Any ideas what would be causing it?PHP Warning: fwrite(): supplied resource is not a valid stream resource in /home/adminuser/storage/modification/system/library/log.php on line 31 PHP Warning: fwrite() expects parameter 1 to be resource, bool given in /home/adminuser/storage/modification/system/library/log.php on line 31
File/folder permissions:/storage/ drwxr-xr-x 5 adminuser adminuser 4096 Apr 23 08:15 modification /storage/modification/ drwxr-xr-x 5 adminuser adminuser 4096 Apr 23 08:15 system /storage/modification/system/ drwxr-xr-x 5 adminuser adminuser 4096 Apr 25 10:25 library /storage/modification/system/library -rw-r--r-- 1 adminuser adminuser 995 Apr 23 08:15 log.php
Line 31 on log.phppublic function write($message) { fwrite($this->handle, date('Y-m-d G:i:s') . ' - ' . print_r($message, true) . "\n" . 'URL: ' . (isset($_SERVER['REQUEST_URI'>) ? $_SERVER['REQUEST_URI'> : '') . "\n" . ' REFFER: ' . (isset($_SERVER['HTTP_REFERER'>) ? $_SERVER['HTTP_REFERER'> : '') . "\n" . '------------------------------------------------------------------------------------------------' . "\n");0 -
That seems more like a PHP error than a permissions error, so I don't have much to provide on my side of things for that. 0 -
That seems more like a PHP error than a permissions error, so I don't have much to provide on my side of things for that.
OK. I edited the post to include the code from the log.php file in case there's anything relevant...0 -
I'm glad our team was able to help with that! 0
Please sign in to leave a comment.
Comments
10 comments