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.

Database connection error after updating to PHP7

Discussion in 'EasyApache' started by kanbam, Feb 26, 2016.

  1. kanbam

    kanbam Member

    Joined:
    Aug 16, 2013
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    cPanelJacob announced (PHP7 support) PHP7 was available to install with easyapache 4.

    I installed the base packages, enabled the option in the easyapache 4 provision profile and rebuit. Then in "MultiPHP Manager" select the domain to use PHP7.

    The webpage gives this error when using PHP7:
    "Database connection error (1): The MySQL adapter 'mysql' is not available.Database connection error (1): The MySQL adapter 'mysql' is not available."

    The webpage works correctly in PHP 5.6.

    I think I am missing some configuration setting in the PHP7 php.ini
     
  2. cPJacob

    cPJacob cPanel Product Owner
    Staff Member

    Joined:
    May 2, 2014
    Messages:
    508
    Likes Received:
    64
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    Check out that blog post a little bit towards the bottom, specifically the deprecation section. PHP 7 no longer supports the MySQL extension, and by your error, your script will not work on PHP 7 because it's using a removed extension. You'll either need to upgrade your script, wait for the developers to support PHP 7, or this script might be stuck with using PHP 5.
     
  3. syslint

    syslint Well-Known Member

    Joined:
    Oct 9, 2006
    Messages:
    249
    Likes Received:
    6
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    yes , you should use "mysqli" instead of mysql
     
Loading...

Share This Page