Changing PHP version without changing PHP Extensions

Discussion in 'IT & Internet' started by UKSBD, Aug 24, 2020.

  1. UKSBD

    UKSBD Not a real duck Staff Member

    10,234 2,011
    I have a Hex Dec Converter that has worked fine for years.
    https://www.uksbd.co.uk/converter/

    I Just noticed it was no longer working

    I updated to PHP 7.4 recently and after seeing my converter wasn't working checked my PHP extensions to find bcmath was disabled when doing the update.

    I had something similar happen on a previous PHP update where my PDO was disabled

    Do PHP extensions always get altered when updating PHP in cPanel?

    It can be a right pain if you don't notice something has stopped working or don't know why.
     
    Posted: Aug 24, 2020 By: UKSBD Member since: Dec 30, 2005
    #1
  2. WESH.UK

    WESH.UK UKBF Regular Free Member

    105 23
    Hiya UKSBD

    When adding a new PHP version to a cPanel server, the server admin should where possible, add and compile all of the exact same extensions/modules as already set-up for previous versions.

    So if you had BCMath already compiled in 7.2 and 7.3, then it should be compiled into 7.4,

    If it was missing, then whoever compiled your PHP is the person that missed this.

    PHP extensions do of course get updated on a per-version basis, so each version of PHP has its own module version, but the module should never simply go missing or be disabled.

    Hope that helps.
     
    Posted: Aug 24, 2020 By: WESH.UK Member since: Aug 11, 2018
    #2
  3. Alan

    Alan UKBF Legend Full Member - Verified Business

    6,611 1,828
    I assume you updated by C-Panel. It seems that hosts have to set up the default extensions for each version, I'm not 100% sure a I have never been the C-Panel side as host.
     
    Posted: Aug 24, 2020 By: Alan Member since: Aug 16, 2011
    #3
  4. Alan

    Alan UKBF Legend Full Member - Verified Business

    6,611 1,828
    I don't think it is a matter of missing, but 'unticked' by default in the later version when ticked in the earlier version. I.e. the setting are not carried forward in C-Panel
     
    Posted: Aug 24, 2020 By: Alan Member since: Aug 16, 2011
    #4
  5. WESH.UK

    WESH.UK UKBF Regular Free Member

    105 23
    That's exactly what I said, it was missed. Not checked, not enabled, call it what you will :)
     
    Posted: Aug 24, 2020 By: WESH.UK Member since: Aug 11, 2018
    #5
  6. Alan

    Alan UKBF Legend Full Member - Verified Business

    6,611 1,828
    I read that as 'not available at all'.

    Just for my information then, if in c-panel in PHP 7.3 let's say zip is not ticked ( by default) , so a user ticks zip. And then switches to 7.4 is C Panel meant to remember the change across versions?
     
    Posted: Aug 24, 2020 By: Alan Member since: Aug 16, 2011
    #6
  7. WESH.UK

    WESH.UK UKBF Regular Free Member

    105 23
    I cant see how or why, as it doesn't say anything like that at all... :)

    There are 2 interfaces, cPanel (Users) and WHM (Admin). If whoever compiled PHP, within WHM or via Command line doesn't include that PHP module within the build of that PHP version, then it will not be available to the end-user within cPanel at all.

    There is also another layer of confusion too, because if your server uses CloudLinux, which all of ours do, then there is also a way to enable everything at the server level, then simply let a user decide what they want to enable or not, but again, if it's not enabled within CloudLinux, then you won't be able to select it within cPanel either.
     
    Posted: Aug 24, 2020 By: WESH.UK Member since: Aug 11, 2018
    #7
  8. Alan

    Alan UKBF Legend Full Member - Verified Business

    6,611 1,828
    I don't think you understand my question so I'll park it for now.
     
    Posted: Aug 24, 2020 By: Alan Member since: Aug 16, 2011
    #8
  9. WESH.UK

    WESH.UK UKBF Regular Free Member

    105 23
    Understood it perfectly, but typically, there is no option to "tick" or select PHP modules within cPanel unless CloudLinux is involved, hence my answer.

    Without CloudLinux, a cPanel user has no option to select any PHP modules at all, its all done by the server admin.

    If CloudLinux is installed then it could be a combo of either the admin did make it available but user didn't select it, OR, the admin didn't compile it to start with so it wasn't available to select.

    If switching PHP versions using either method, then yes, the modules should be retained in the selections, if they are available.
     
    Posted: Aug 24, 2020 By: WESH.UK Member since: Aug 11, 2018
    #9
  10. Alan

    Alan UKBF Legend Full Member - Verified Business

    6,611 1,828
    Posted: Aug 24, 2020 By: Alan Member since: Aug 16, 2011
    #10
  11. UKSBD

    UKSBD Not a real duck Staff Member

    10,234 2,011
    I do get the option to tick what I want to activate

    Looking in to it more I think it's down to me not the host

    I have a reseller account and checked to find that bcmath isn't enabled with any of my sites where this one is hosted

    I moved the hosting on this one recently so I'm assuming the converter hasn't been working ever since I moved it but just hadn't noticed until today.

    My old host must have had it enabled by default where as with my new host I have to enable it if I want it.
     
    Posted: Aug 24, 2020 By: UKSBD Member since: Dec 30, 2005
    #11
  12. UKSBD

    UKSBD Not a real duck Staff Member

    10,234 2,011
    Posted: Aug 24, 2020 By: UKSBD Member since: Dec 30, 2005
    #12
  13. UKSBD

    UKSBD Not a real duck Staff Member

    10,234 2,011
    I just ticked bcmath on a site using 7.2

    Then updated to 7.4 and it unticked bcmath

    If people don't know about these things but update their PHP because their told to, it could cause all sorts of problems.
     
    Posted: Aug 24, 2020 By: UKSBD Member since: Dec 30, 2005
    #13
  14. WESH.UK

    WESH.UK UKBF Regular Free Member

    105 23
    We had our setup so that it would already tick a load of default popular options then you could change it as needed.

    We stopped using this option for PHP upgrades it in the end due to the amount of confusion it causes, we simply have PHP upgrades managed within cPanel, so you can pick which version you want, and it will have the same options as your last version, all pre-set by us at the server level.

    We still use CloudLinux, but the PHP version changes don't require you to know what to tick or untick :)
     
    Posted: Aug 24, 2020 By: WESH.UK Member since: Aug 11, 2018
    #14
  15. WebDesires

    WebDesires UKBF Regular Full Member

    263 44
    This has been default behaviour for all of time, each version of PHP has its OWN set of modules - between PHP versions modules change, get removed or replaced. So when you install a new PHP version you have to install that versions modules too.

    EasyApache 3 UI shows this in the best logical sense, you will see for example BCMATH and then the PHP version, so ie if you had PHP 5, 7.2 and 7.3 you would see BCMATH 3 times in the list - one module for each version.
     
    Posted: Aug 25, 2020 By: WebDesires Member since: Feb 23, 2016
    #15
  16. UKSBD

    UKSBD Not a real duck Staff Member

    10,234 2,011
    So it's the host who decides which are enabled by default when they include the option to update your PHP?

    If the host don't enable it by default and don't provide a way of enabling it, we're stuffed?

    Why are some things enabled and others not, do hosts just enable the more common modules?
     
    Posted: Aug 25, 2020 By: UKSBD Member since: Dec 30, 2005
    #16
  17. WebDesires

    WebDesires UKBF Regular Full Member

    263 44
    I clearly can see you have WHM access, so you are essentially in control of your own server? So you can do this yourself from WHM using EasyApache.

    But yes, if you do not have your own unmanaged server, you have to contact your host.
     
    Posted: Aug 25, 2020 By: WebDesires Member since: Feb 23, 2016
    #17
  18. UKSBD

    UKSBD Not a real duck Staff Member

    10,234 2,011
    I have 2 different hosts both with WHM and cPanel

    One has MultiPHP Manager which appears to let me select PHP versions but not PHP extensions/modules.

    The other has Select PHP version which allows me to select PHP versions and also tick which extensions I want enabled/activated

    The 1st host (who doesn't allow changes) must have bcmath activated by default, but the 2nd one doesn't
     
    Posted: Aug 25, 2020 By: UKSBD Member since: Dec 30, 2005
    #18
  19. WebDesires

    WebDesires UKBF Regular Full Member

    263 44
    MultiPHP does not handle modules - EasyApache does the install of PHP and modules.

    Sounds like even though you have WHM on both, they are limited to select features, so you have Managed hosting which means you are not in complete control of either server.

    You will have to contact your hosting provider I am afraid.
     
    Posted: Aug 25, 2020 By: WebDesires Member since: Feb 23, 2016
    #19
  20. UKSBD

    UKSBD Not a real duck Staff Member

    10,234 2,011
    I can do what I need to do, go in and tick to enable.

    It just looks like I have to remember to do this every time I upgrade the PHP version
     
    Posted: Aug 25, 2020 By: UKSBD Member since: Dec 30, 2005
    #20