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!

Changing PHP version causes unexpected database error

Discussion in 'Database Discussion' started by AndyX, Sep 25, 2015.

  1. AndyX

    AndyX Active Member

    Joined:
    Sep 25, 2015
    Messages:
    35
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Los Altos, CA
    cPanel Access Level:
    Website Owner
    Currently the PHP version on the shared server I'm working on at GoDaddy is 5.4 (native), but it doesn't support Imagick. If I select PHP 5.4 or PHP 5.5 it includes Imagick so I would like to switch to it. The problem is when I select another PHP version, the XenForo forum dies, the error message is:

    The tech support at GoDaddy was unable to provide a reason why the database stops working for XenForo yet works for the WordPress database.
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    718
    Likes Received:
    122
    Trophy Points:
    168
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    That is a generic error message, you need to find the actual one, my guess is the new version of PHP probably doesn't have mysqli built or enabled. Is GoDaddy using CL now? If so, when you select the PHP version you should be able to select different PHP mods as well like mysqli, pdo, etc. If you can link a PHP info script I may be able to help, if you also have SSH access I would search for any error_log as the actual error message is most likely in one of those.

    In your public_html do:

    # find . -type f -name error_log -exec tail -5 {} \;

    That will find all error logs and output the last 5 lines in each which should hopefully help and narrow it down.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. AndyX

    AndyX Active Member

    Joined:
    Sep 25, 2015
    Messages:
    35
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Los Altos, CA
    cPanel Access Level:
    Website Owner
    Hello,

    Thank you for your help. When I select PHP 5.5 I get the following defaults:

    pic001.jpg

    Looking at other web sites I manage I compared and it looks like everything is enabled properly. Again the issue is XenForo forum software is not able to be run because of the unexpected database error.

    I don't have SSH access as this is a shared server.
     
    #3 AndyX, Sep 25, 2015
    Last edited by a moderator: Sep 25, 2015
  4. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    718
    Likes Received:
    122
    Trophy Points:
    168
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Yeah the unexpected database error is most likely because it cannot connect to the database. If you enable PHP 5.5 again, refresh the site, then right click it and goto view source. Is there anything output there in source code that gives anymore info other than 'unexpected database error' which again is a generic response not an actual error.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. AndyX

    AndyX Active Member

    Joined:
    Sep 25, 2015
    Messages:
    35
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Los Altos, CA
    cPanel Access Level:
    Website Owner
    Excellent suggestion. This is what source shows:

     
  6. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    718
    Likes Received:
    122
    Trophy Points:
    168
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Hmm so it should be working then as I see you clearly selected it in PHP selector.

    Can you link me to a php info script while PHP 5.5 is loaded.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. AndyX

    AndyX Active Member

    Joined:
    Sep 25, 2015
    Messages:
    35
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Los Altos, CA
    cPanel Access Level:
    Website Owner
    Hi jcats,

    With your help I finally got this working, thank you.

    In order to make Imagick PECL extension work on GoDaddy I had to do the following:

    1) In cPanel switch from PHP 5.4 native to PHP 5.5.
    2) Delete public_html/php.ini as that prevented MySQLI from loading.
     
    Infopro likes this.
  8. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    718
    Likes Received:
    122
    Trophy Points:
    168
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Hmm that is strange as I didn't even think php.ini was recognized when using the php selector. I am glad to hear you got it resolved though
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. JMTG

    JMTG Registered

    Joined:
    Oct 1, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    New York
    cPanel Access Level:
    Website Owner
    Thank you guys, it worked for me
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,323
    Likes Received:
    1,851
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    I am happy to see the issue is now resolved. Thank you for updating us with the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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