after upgrade to php7 connection to mysql from php DB returns DB Error: extension not foundPHP and MySQL not...

How strictly should I take "Candidates must be local"?

Peter's Strange Word

If the Captain's screens are out, does he switch seats with the co-pilot?

Virginia employer terminated employee and wants signing bonus returned

What does a stand alone "T" index value do?

Replacing Windows 7 security updates with anti-virus?

Do Bugbears' arms literally get longer when it's their turn?

Is there an elementary proof that there are infinitely many primes that are *not* completely split in an abelian extension?

Who deserves to be first and second author? PhD student who collected data, research associate who wrote the paper or supervisor?

"One can do his homework in the library"

Best approach to update all entries in a list that is paginated?

Could you please stop shuffling the deck and play already?

They call me Inspector Morse

Solving "Resistance between two nodes on a grid" problem in Mathematica

Make a transparent 448*448 image

How do you like my writing?

Is "history" a male-biased word ("his+story")?

Time travel short story where dinosaur doesn't taste like chicken

Good allowance savings plan?

Why does Captain Marvel assume the people on this planet know this?

How do I locate a classical quotation?

Are the terms "stab" and "staccato" synonyms?

How did the power source of Mar-Vell's aircraft end up with her?

Why would a jet engine that runs at temps excess of 2000°C burn when it crashes?



after upgrade to php7 connection to mysql from php DB returns DB Error: extension not found


PHP and MySQL not communicatingInstall Apache, Php, Mysql latest versions not available via aptMysql/php connectionUnable to access remotely (LAMP issue)PHP installation appears to be missing the MySQL extensionMySQL support not available. after upgrade to 16.04.1 from 14.04Your PHP installation appears to be missing the MySQL extension which is required by WordPressMysql extension is missing in php7 installation. Ubuntu 16.04None of the supported PHP extension for adminer even after linking php with mysqlPHP MySql Invalid username/password error













0















After upgrading from ubuntu 14.03 to 16.04. I cannot connect to mysql from php DB. The following code returns



<?php
include_once('DB.php');
$conninfo = "mysql://xxxx:ppppp@localhost/ddddd";
$db = DB::connect($conninfo);
if (DB::isError($db)) {
print $db->getMessage();
exit;
} else {
$result = $db->query("SELECT distinct did from selections where cid=6 order by did DESC;");
while ($result->fetchInto($row, DB_FETCHMODE_ASSOC)) {
extract($row);
print "$didn";
}
$result->free();
}
$db->disconnect();
?>


DB Error: extension not found.



Note that from mysql, opened from the terminal, I see the contents of the table's column 'did'.



Following the advice of oerdnj from a similar post, I confirm that




  1. php7.0-mysql package is installed

  2. mysqli appears in phpinfo. Below is the result of phpinfo | grep mysqli

  3. and listed below is the output for the ldd command



php -r 'phpinfo();' | grep -i mysqli
/etc/php/7.0/cli/conf.d/20-mysqli.ini,
mysqli
MysqlI Support => enabled
mysqli.allow_local_infile => On => On
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqli.rollback_on_cached_plink => Off => Off
API Extensions => mysqli,pdo_mysql



ldd /usr/lib/php/*/mysqli.so
linux-vdso.so.1 => (0x00007ffc807a9000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6cde88a000)
/lib64/ld-linux-x86-64.so.2 (0x000055a1af509000)




Please help.










share|improve this question














bumped to the homepage by Community 3 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    After upgrading from ubuntu 14.03 to 16.04. I cannot connect to mysql from php DB. The following code returns



    <?php
    include_once('DB.php');
    $conninfo = "mysql://xxxx:ppppp@localhost/ddddd";
    $db = DB::connect($conninfo);
    if (DB::isError($db)) {
    print $db->getMessage();
    exit;
    } else {
    $result = $db->query("SELECT distinct did from selections where cid=6 order by did DESC;");
    while ($result->fetchInto($row, DB_FETCHMODE_ASSOC)) {
    extract($row);
    print "$didn";
    }
    $result->free();
    }
    $db->disconnect();
    ?>


    DB Error: extension not found.



    Note that from mysql, opened from the terminal, I see the contents of the table's column 'did'.



    Following the advice of oerdnj from a similar post, I confirm that




    1. php7.0-mysql package is installed

    2. mysqli appears in phpinfo. Below is the result of phpinfo | grep mysqli

    3. and listed below is the output for the ldd command



    php -r 'phpinfo();' | grep -i mysqli
    /etc/php/7.0/cli/conf.d/20-mysqli.ini,
    mysqli
    MysqlI Support => enabled
    mysqli.allow_local_infile => On => On
    mysqli.allow_persistent => On => On
    mysqli.default_host => no value => no value
    mysqli.default_port => 3306 => 3306
    mysqli.default_pw => no value => no value
    mysqli.default_socket => no value => no value
    mysqli.default_user => no value => no value
    mysqli.max_links => Unlimited => Unlimited
    mysqli.max_persistent => Unlimited => Unlimited
    mysqli.reconnect => Off => Off
    mysqli.rollback_on_cached_plink => Off => Off
    API Extensions => mysqli,pdo_mysql



    ldd /usr/lib/php/*/mysqli.so
    linux-vdso.so.1 => (0x00007ffc807a9000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6cde88a000)
    /lib64/ld-linux-x86-64.so.2 (0x000055a1af509000)




    Please help.










    share|improve this question














    bumped to the homepage by Community 3 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      After upgrading from ubuntu 14.03 to 16.04. I cannot connect to mysql from php DB. The following code returns



      <?php
      include_once('DB.php');
      $conninfo = "mysql://xxxx:ppppp@localhost/ddddd";
      $db = DB::connect($conninfo);
      if (DB::isError($db)) {
      print $db->getMessage();
      exit;
      } else {
      $result = $db->query("SELECT distinct did from selections where cid=6 order by did DESC;");
      while ($result->fetchInto($row, DB_FETCHMODE_ASSOC)) {
      extract($row);
      print "$didn";
      }
      $result->free();
      }
      $db->disconnect();
      ?>


      DB Error: extension not found.



      Note that from mysql, opened from the terminal, I see the contents of the table's column 'did'.



      Following the advice of oerdnj from a similar post, I confirm that




      1. php7.0-mysql package is installed

      2. mysqli appears in phpinfo. Below is the result of phpinfo | grep mysqli

      3. and listed below is the output for the ldd command



      php -r 'phpinfo();' | grep -i mysqli
      /etc/php/7.0/cli/conf.d/20-mysqli.ini,
      mysqli
      MysqlI Support => enabled
      mysqli.allow_local_infile => On => On
      mysqli.allow_persistent => On => On
      mysqli.default_host => no value => no value
      mysqli.default_port => 3306 => 3306
      mysqli.default_pw => no value => no value
      mysqli.default_socket => no value => no value
      mysqli.default_user => no value => no value
      mysqli.max_links => Unlimited => Unlimited
      mysqli.max_persistent => Unlimited => Unlimited
      mysqli.reconnect => Off => Off
      mysqli.rollback_on_cached_plink => Off => Off
      API Extensions => mysqli,pdo_mysql



      ldd /usr/lib/php/*/mysqli.so
      linux-vdso.so.1 => (0x00007ffc807a9000)
      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6cde88a000)
      /lib64/ld-linux-x86-64.so.2 (0x000055a1af509000)




      Please help.










      share|improve this question














      After upgrading from ubuntu 14.03 to 16.04. I cannot connect to mysql from php DB. The following code returns



      <?php
      include_once('DB.php');
      $conninfo = "mysql://xxxx:ppppp@localhost/ddddd";
      $db = DB::connect($conninfo);
      if (DB::isError($db)) {
      print $db->getMessage();
      exit;
      } else {
      $result = $db->query("SELECT distinct did from selections where cid=6 order by did DESC;");
      while ($result->fetchInto($row, DB_FETCHMODE_ASSOC)) {
      extract($row);
      print "$didn";
      }
      $result->free();
      }
      $db->disconnect();
      ?>


      DB Error: extension not found.



      Note that from mysql, opened from the terminal, I see the contents of the table's column 'did'.



      Following the advice of oerdnj from a similar post, I confirm that




      1. php7.0-mysql package is installed

      2. mysqli appears in phpinfo. Below is the result of phpinfo | grep mysqli

      3. and listed below is the output for the ldd command



      php -r 'phpinfo();' | grep -i mysqli
      /etc/php/7.0/cli/conf.d/20-mysqli.ini,
      mysqli
      MysqlI Support => enabled
      mysqli.allow_local_infile => On => On
      mysqli.allow_persistent => On => On
      mysqli.default_host => no value => no value
      mysqli.default_port => 3306 => 3306
      mysqli.default_pw => no value => no value
      mysqli.default_socket => no value => no value
      mysqli.default_user => no value => no value
      mysqli.max_links => Unlimited => Unlimited
      mysqli.max_persistent => Unlimited => Unlimited
      mysqli.reconnect => Off => Off
      mysqli.rollback_on_cached_plink => Off => Off
      API Extensions => mysqli,pdo_mysql



      ldd /usr/lib/php/*/mysqli.so
      linux-vdso.so.1 => (0x00007ffc807a9000)
      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6cde88a000)
      /lib64/ld-linux-x86-64.so.2 (0x000055a1af509000)




      Please help.







      apache2 php mysql






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 7 '16 at 20:31









      tempestcattempestcat

      625




      625





      bumped to the homepage by Community 3 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 3 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I changed $conninfo = "mysql://xxxx:ppppp@localhost/ddddd"; to $conninfo = "mysqli://xxxx:ppppp@localhost/ddddd"; and now it works. I don't understand why mysql worked in php5 but not in php7






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f809375%2fafter-upgrade-to-php7-connection-to-mysql-from-php-db-returns-db-error-extensio%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I changed $conninfo = "mysql://xxxx:ppppp@localhost/ddddd"; to $conninfo = "mysqli://xxxx:ppppp@localhost/ddddd"; and now it works. I don't understand why mysql worked in php5 but not in php7






            share|improve this answer




























              0














              I changed $conninfo = "mysql://xxxx:ppppp@localhost/ddddd"; to $conninfo = "mysqli://xxxx:ppppp@localhost/ddddd"; and now it works. I don't understand why mysql worked in php5 but not in php7






              share|improve this answer


























                0












                0








                0







                I changed $conninfo = "mysql://xxxx:ppppp@localhost/ddddd"; to $conninfo = "mysqli://xxxx:ppppp@localhost/ddddd"; and now it works. I don't understand why mysql worked in php5 but not in php7






                share|improve this answer













                I changed $conninfo = "mysql://xxxx:ppppp@localhost/ddddd"; to $conninfo = "mysqli://xxxx:ppppp@localhost/ddddd"; and now it works. I don't understand why mysql worked in php5 but not in php7







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 8 '16 at 0:31









                tempestcattempestcat

                625




                625






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f809375%2fafter-upgrade-to-php7-connection-to-mysql-from-php-db-returns-db-error-extensio%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    List of shipwrecks in 1808...

                    Is there a lightweight tool to crop images quickly?Cropping Images using Command Line Tools OnlyHow to crop...

                    How do I enter a file or directory with special characters in its name?How to write the path of a folder with...