Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

New Server - Permission Issues and Missing error_log

Discussion in 'General Discussion' started by stapuff106, Sep 20, 2017.

  1. stapuff106

    stapuff106 Member

    Joined:
    Aug 4, 2017
    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  3. stapuff106

    stapuff106 Member

    Joined:
    Aug 4, 2017
    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Chicago
    cPanel Access Level:
    Root Administrator
    Where would I go in the old server Apache 3 to see what PHP handlers were enabled?

    Thanks
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  5. stapuff106

    stapuff106 Member

    Joined:
    Aug 4, 2017
    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    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
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  7. stapuff106

    stapuff106 Member

    Joined:
    Aug 4, 2017
    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Chicago
    cPanel Access Level:
    Root Administrator
    I appreciate the pointer... will take a look at that setting.

    stapuff
     
Loading...

Share This Page