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.

Webserver using PHP 5.4 despite being set to 5.6

Discussion in 'CloudLinux' started by DennisMidjord, Jan 10, 2017.

Tags:
  1. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Hi,

    One of our customers contacted us about some PHP extensions that wasn't enabled despite being enabled under 'Select PHP version'. I quickly saw that his website (which is an addon domain with document root in /domainfolder) was using PHP 5.4, despite being set to 5.6. This was not the issue with his primary domain from the public_html folder.

    What could be causing this issue?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Is this system using EasyApache 4? Are any third-party applications such as CloudLinux with PHP Selector installed? Have you verified the domain name in-question resolves to the cPanel server?

    Thank you.
     
  3. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Hello,

    It's using EasyApache3 on CloudLinux. I've checked that the website is indeed resolving to the cPanel server.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    EasyApache 3 does not support MultiPHP functionality, suggesting the use of PHP Selector on the system:

    CloudLinux Documentation

    Please review the above document from CloudLinux to ensure you are using it correctly on the system.

    Thank you.
     
  5. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    I'm a bit confused. I might've misunderstood what MultiPHP is then.
    It works fine in the public_html folder (also switching PHP version), so I don't understand why it won't use the same version on an addon domain.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    MultiPHP is only offered with EasyApache version 4. You're using PHP Selector with CloudLinux, which is a third-party application developed by CloudLinux and not cPanel.

    What's the .htaccess file within the subdirectory associated with the addon domain name look like? There's an article here you may find helpful:

    Different PHP versions per directories using SuPHP – CloudLinux KnowledgeBase

    Thank you.
     
  7. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    There's no .htaccess, it seems. Well, I upgraded to EasyApache 4 and everything worked right after.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    I'm happy to see it's now working well. Feel free to let us know if we can be of any further assistance.

    Thanks!
     
  9. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    Thanks for replying so quick!
    I got one more question. I see that php_value are not allowed in .htaccess with EasyApache4 - does this mean every account has to have a php.ini file where php values are set?
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    It's still allowed if you are using DSO as your PHP handler. The following document is helpful as well:

    The cPanel PHPRC PHP Patch for EasyApache 4 - EasyApache 4 - cPanel Documentation

    Additionally, feel free to review this post:

    In Progress - EA4 php.ini/local.ini behavior

    Thank you.
     
  11. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Oh, I just couldn't find DSO under PHP Extensions. According to this guide, it should be there, right?
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Per that document:

    You can install the DSO PHP package in the PHP Extensions section of WHM's EasyApache 4 interface (WHM Home >> Software >> EasyApache 4). Keep in mind you can only use DSO as the handler for one version of PHP on your system.

    Thank you.
     
  13. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Hi,

    I already tried that. There's no DSO PHP package.
    upload_2017-1-11_0-40-49.png
     
    #13 DennisMidjord, Jan 10, 2017
    Last edited by a moderator: Jan 11, 2017
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The DSO package for PHP with EasyApache 4 is named with the "-php" suffix. For example, the DSO package for PHP 7.0 is:

    ea-php70-php

    You'd search for php70-php when installing it via the EA4 interface in WHM, or install it via the command line with a command such as:

    Code:
    yum install ea-php70-php
    Note that you can only run one DSO package at a time.

    Thanks!
     
  15. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Hi,

    Thanks! I installed the DSO package for 5.6 as this is the most used by our clients.
    I must say that I really like the 'new' way of doing it in EA4. Would it be safe to remove PHP Version Selector using yum groupremove alt-php? Would that mess something up?
     
  16. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    It's possible it will change the way PHP is configured for your existing accounts and addon domain names. Ensure you review the documentation for PHP Selector and EasyApache 4 provided by CloudLinux before removing it:

    PHP Selector > Control Panel Integration > cPanel

    Thank you.
     
  17. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Hi,

    It seems like the upgrade to EasyApache4 caused more problems than I had thought. If we downgrate to EasyApache3 using /scripts/migrate_ea3_to_ea4 --revert --run, does everything then work as before?
     
  18. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Yes, it reverts the last EasyApache 3 profile that was built. That said, are there any specific issues with EasyApache 4 that you'd like us to help troubleshoot?

    Thank you.
     
  19. DennisMidjord

    DennisMidjord Well-Known Member

    Joined:
    Sep 27, 2016
    Messages:
    82
    Likes Received:
    3
    Trophy Points:
    8
    Location:
    Denmark
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    It wasn't really issues with EasyApache4 (although navigating was different) - it was our clients. Some were using PHP 5.4, some PHP 5.6, and some PHP 7. This caused a lot of issues as all of them used the one we set as default. Some clients' websites broke down.

    I need to read more about EasyApache4 before I make the change. Your help is much appreciated, though!
     
    cPanelMichael likes this.
Loading...

Share This Page