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!

SOLVED Error changing PHP version

Discussion in 'EasyApache' started by kernow, Jun 15, 2019.

  1. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    965
    Likes Received:
    33
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    Were unable to change the PHP version on one domain name. The error appears to relate to a .htaccess file. The .htaccess file has correct permissions (0644) and ownership.

    Code:
    Error: (XID h5ymd3) 1 error occurred: Error #1: The system failed to apply the “PHP” version to “example.com”: Cpanel::Exception::IO::FileCreateError/(XID pm97cr) The system failed to create the file “/.htaccess.lock” (as EUID: 823, EGID: 834 834) because of the following error: Permission denied at /usr/local/cpanel/Cpanel/SafeFile.pm line 376. Cpanel::SafeFile::_safelock("/.htaccess") called at /usr/local/cpanel/Cpanel/SafeFile.pm line 557 Cpanel::SafeFile::_safe_open(undef, 66, "/.htaccess", CODE(0x39e6098), "safesysopen") called at /usr/local/cpanel/Cpanel/SafeFile.pm line 214 eval {...} called at /usr/local/cpanel/Cpanel/SafeFile.pm line 213 Cpanel::SafeFile::safesysopen(undef, "/.htaccess", 66, 420) called at /usr/local/cpanel/Cpanel/SafeFile.pm line 128 Cpanel::SafeFile::safesysopen_no_warn_on_fail(undef, "/.htaccess", 66, 420) called at /usr/local/cpanel/Cpanel/Transaction/File/Base.pm line 130 Cpanel::Transaction::File::Base::new("Cpanel::Transaction::File::Raw", "path", "/.htaccess", "permissions", 420, "restore_original_permissions", 1) called at /usr/local/cpanel/Cpanel/WebServer/Supported/apache/Htaccess.pm line 190 Cpanel::WebServer::Supported::apache::Htaccess::_internal_set_handler(Cpanel::WebServer::Supported::apache::Htaccess=HASH(0x398f3a8), "userdata", 
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. vacancy

    vacancy Well-Known Member

    Joined:
    Sep 20, 2012
    Messages:
    278
    Likes Received:
    65
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    Did you check the file ownership?

    Try;
    Code:
    chown -R username:username /home/username/public_html/.htaccess
     
  3. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    965
    Likes Received:
    33
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    As I mentioned in my post, The .htaccess file has correct permissions (0644) and ownership.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,476
    Likes Received:
    507
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Is there an .htaccess file in /home or /home/user not just /home/user/public_html?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    965
    Likes Received:
    33
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    There is no .htaccess file in /home and all .htaccess files in this particular /home/user * have correct permissions and ownership.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    212
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Could you try doing ls -la of the .htaccess in /home/user and /home/user/public_html?
     
  7. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    965
    Likes Received:
    33
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    Well I have obviously already done that to check the ownership and permissions ;)
    But thanks anyway.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    212
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    I wanted you to post it here. Could be that you're missing something.
    Are you able to change the PHP version if you set chmod 777 on the .htaccess?
     
  9. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    965
    Likes Received:
    33
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    Code:
    ls -lah public_html/.htaccess
    -rw-r--r-- 1 user user 593 Jan 22  2018 public_html/user/.htaccess
    Changing .htaccess permissions to 777 makes no difference.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    212
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    What are the permissions for /home/userdir and subfolders?
    Looking further at the error, it seems like it can't create the .htaccess.lock file. Something could seem like the user can't write in the directory.
     
  11. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    965
    Likes Received:
    33
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    The domain in question is an addon domain in /public_html so the permissions are 750 with sub directories of 755. The domains dir is written to daily so no problem there.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    212
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    But what are the permissions in /home/userdir?
    It seems like cPanel is trying to create /.htaccess.lock, so it could seem like cPanel is creating it in the homedir.
     
  13. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    965
    Likes Received:
    33
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    The permissions are all OK. This user has several addon domains, all but one can have different versions of PHP. As mentioned above, the problem domain is in /public_html so the permissions are 750 with sub directories of 755
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,476
    Likes Received:
    507
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    As it doesn't seem we're getting too far with this through this avenue, can you please open a ticket using the link in my signature? Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved.


    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    965
    Likes Received:
    33
    Trophy Points:
    178
    cPanel Access Level:
    Root Administrator
    Ticket ID 12638593
    This has now been resolved.
    What was happening is that the domain name in question is an addon domain but it had two config files in /var/cpanel/userdata/username It should only have one. Sean Malen corrected this by moving the domains files.

     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    cPanelLauren likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice