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.

Changing PHP version causes unexpected database error

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

  1. AndyX

    AndyX Member

    Joined:
    Sep 25, 2015
    Messages:
    9
    Likes Received:
    2
    Trophy Points:
    3
    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:
    275
    Likes Received:
    31
    Trophy Points:
    28
    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.
     
  3. AndyX

    AndyX Member

    Joined:
    Sep 25, 2015
    Messages:
    9
    Likes Received:
    2
    Trophy Points:
    3
    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:
    275
    Likes Received:
    31
    Trophy Points:
    28
    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.
     
  5. AndyX

    AndyX Member

    Joined:
    Sep 25, 2015
    Messages:
    9
    Likes Received:
    2
    Trophy Points:
    3
    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:
    275
    Likes Received:
    31
    Trophy Points:
    28
    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.
     
  7. AndyX

    AndyX Member

    Joined:
    Sep 25, 2015
    Messages:
    9
    Likes Received:
    2
    Trophy Points:
    3
    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:
    275
    Likes Received:
    31
    Trophy Points:
    28
    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
     
  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:
    30,678
    Likes Received:
    652
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page