New Server - Permission Issues and Missing error_log

stapuff106

Member
Aug 4, 2017
17
1
3
Chicago
cPanel Access Level
Root Administrator
New Server - Permission Issues and Missing error_log

I switched to a new larger server and now am getting permission issues and no error_log being outputted.
Tested 2 simple php functions that worked with no issues in the last server.
I show below what was done to "fix" the issues, however, it is not a global fix. I will have to do this for every domain on the server.
Are there settings I need to change that I am missing that would make the permissions issues go away globally?
What do I need to do to produce the error_log?

Function 1 returns this:
Code:
Warning: fopen(/home/username/public_html/test.png): failed to open stream: Permission denied in /home/username/public_html/test.php on line 13
Warning: fputs() expects parameter 1 to be resource, boolean given in /home/username/public_html/test.php on line 14
Warning: fclose() expects parameter 1 to be resource, boolean given in /home/username/public_html/test.php on line 15
Fix the issues with this command line:
Code:
chmod go+w /home/username/public_html/test.png

Function 2 returns this:
Code:
Warning: mkdir(): Permission denied in /home/username/public_html/test.php on line 25
Warning: file_put_contents(test.txt): failed to open stream: Permission denied in /home/username/public_html/test.php on line 48
Warning: file_put_contents(test.txt): failed to open stream: Permission denied in /home/username/public_html/test.php on line 51
Fixed the issue with this command line:
Code:
chmod g+w public_html/

My Setup

Command Line -
Code:
grep '' /etc/redhat-release /usr/local/cpanel/version /var/cpanel/envtype ; grep CPANEL= /etc/cpupdate.conf
Returns -
Code:
/etc/redhat-release:CentOS release 6.9 (Final)
    /usr/local/cpanel/version:11.66.0.23
    /var/cpanel/envtype:virtuozzo
    CPANEL=release

Command Line -
Code:
php -v
Returns -
Code:
PHP Version 5.6.31

Command Line -
Code:
mysql -v
Returns -
Code:
MYSQL Version 5.6.37
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Hello,

Do you know if a different PHP handler was enabled on the previous server? You can configure the default PHP handler for each version of PHP using the "PHP Handlers" tab in "WHM >> MultiPHP Manager". We document the permission and ownership requirements for each PHP handler at:

PHP Handlers - EasyApache 4 - cPanel Documentation

Thank you.
 

stapuff106

Member
Aug 4, 2017
17
1
3
Chicago
cPanel Access Level
Root Administrator
Michael -

I appreciate the response back. That information was not on the server after I upgraded it to 4.

Currently needed to give permissions at public_html level for every domain by command line.

Thanks,

stapuff
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,215
363
Hello,

It's possible this relates to the "Enable File Protect" option under the "Security" tab in "WHM >> Tweak Settings". You can disable this option if you prefer, however we suggest leaving it enabled for the added security.

Thank you.