• mdiehl

    (@mdiehl)


    Hello,

    I’ve been tasked with migrating an existing wp installation to a new server. The new server is a CentOS 7.4 server running Apache 2.4.6.

    When I point my browser to the new site, I get:

    Your PHP installation appears to be missing the MySQL extension which is require

    However, when I run php -i | grep mysql , I get:

    =================================
    /etc/php.d/mysqlnd.ini,
    /etc/php.d/mysqlnd_mysql.ini,
    /etc/php.d/mysqlnd_mysqli.ini,
    /etc/php.d/pdo_mysqlnd.ini,
    mysql
    Client API version => mysqlnd 5.0.10 – 20111026 – $Id: e707c415db32080b3752b232487a435ee0372157 $
    mysql.allow_local_infile => On => On
    mysql.allow_persistent => On => On
    mysql.connect_timeout => 60 => 60
    mysql.default_host => no value => no value
    mysql.default_password => no value => no value
    mysql.default_port => no value => no value
    mysql.default_socket => /var/lib/mysql/mysql.sock => /var/lib/mysql/mysql.sock
    mysql.default_user => no value => no value
    mysql.max_links => Unlimited => Unlimited
    mysql.max_persistent => Unlimited => Unlimited
    mysql.trace_mode => Off => Off
    mysqli
    Client API library version => mysqlnd 5.0.10 – 20111026 – $Id: e707c415db32080b3752b232487a435ee0372157 $
    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 => /var/lib/mysql/mysql.sock => /var/lib/mysql/mysql.sock
    mysqli.default_user => no value => no value
    mysqli.max_links => Unlimited => Unlimited
    mysqli.max_persistent => Unlimited => Unlimited
    mysqli.reconnect => Off => Off
    mysqlnd
    mysqlnd => enabled
    Version => mysqlnd 5.0.10 – 20111026 – $Id: e707c415db32080b3752b232487a435ee0372157 $
    Loaded plugins => mysqlnd,example,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password
    API Extensions => mysql,mysqli,pdo_mysql
    mysqlnd statistics =>
    PDO drivers => mysql, sqlite
    pdo_mysql
    Client API version => mysqlnd 5.0.10 – 20111026 – $Id: e707c415db32080b3752b232487a435ee0372157 $
    pdo_mysql.default_socket => /var/lib/mysql/mysql.sock => /var/lib/mysql/mysql.sock
    =================================

    This seems rational.

    I have moved the old database over to the new server and am able to connect to it with a simple php script:

    <?php
    $mysqli = new mysqli(“localhost”, “wp_user”, “wp_passwd”, “wp_db”);
    if ($mysqli->connect_errno) {
    echo “Failed to connect to MySQL: (” . $mysqli->connect_errno . “) ” . $mysqli->connect_error;
    }

    echo “Run complete\n”;

    ?>

    Of course, I used the same credentials in wp-config.php

    So, I _think_ the system has all it needs.

    What am I missing?

    Thanks in advance,

    Mike.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    sudo yum install php-mysqlnd, assuming you’re using the standard CentOS repos.

    Thread Starter mdiehl

    (@mdiehl)

    Steve,

    Thanks for getting back to me.

    I did what you suggested:

    # sudo yum install php-mysqlnd
    Loaded plugins: fastestmirror
    base | 3.6 kB 00:00:00
    extras | 3.4 kB 00:00:00
    mysql-connectors-community | 2.5 kB 00:00:00
    mysql-tools-community | 2.5 kB 00:00:00
    mysql56-community | 2.5 kB 00:00:00
    updates | 3.4 kB 00:00:00
    Loading mirror speeds from cached hostfile
    * base: mirrors.rit.edu
    * extras: mirror.clarkson.edu
    * updates: mirror.trouble-free.net
    Package php-mysqlnd-5.4.16-43.el7_4.x86_64 already installed and latest version
    Nothing to do

    So, I am still suck. Any other suggestions would be most welcome.

    Thank you,

    Mike.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You’re running PHP 5.4? You should be using 7.1 or 7.2.

    I use the IUS repos on my CentOS 7 system
    https://ius.io/GettingStarted/
    https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-centos-7

    FYI, these are the PHP packages I’m using:

    $ rpm -qa |grep php
    php71u-json-7.1.14-1.ius.centos7.x86_64
    php71u-mbstring-7.1.14-1.ius.centos7.x86_64
    php71u-cli-7.1.14-1.ius.centos7.x86_64
    php71u-soap-7.1.14-1.ius.centos7.x86_64
    php71u-fpm-7.1.14-1.ius.centos7.x86_64
    php71u-process-7.1.14-1.ius.centos7.x86_64
    php-tcpdf-dejavu-sans-fonts-6.2.13-1.el7.noarch
    php-php-gettext-1.0.12-1.el7.noarch
    php71u-pecl-imagick-3.4.3-2.ius.centos7.x86_64
    php71u-devel-7.1.14-1.ius.centos7.x86_64
    mod_php71u-7.1.14-1.ius.centos7.x86_64
    php71u-xml-7.1.14-1.ius.centos7.x86_64
    php71u-opcache-7.1.14-1.ius.centos7.x86_64
    php-pear-Net-Curl-1.2.5-10.el7.noarch
    php-fedora-autoloader-1.0.0-1.el7.noarch
    php71u-common-7.1.14-1.ius.centos7.x86_64
    php71u-mysqlnd-7.1.14-1.ius.centos7.x86_64
    php71u-tidy-7.1.14-1.ius.centos7.x86_64
    php71u-bcmath-7.1.14-1.ius.centos7.x86_64
    phpMyAdmin-4.4.15.10-2.el7.noarch
    php71u-pdo-7.1.14-1.ius.centos7.x86_64
    php71u-gd-7.1.14-1.ius.centos7.x86_64
    php-tcpdf-6.2.13-1.el7.noarch
    
    Thread Starter mdiehl

    (@mdiehl)

    Hi again, Steve,

    Yes, I’m using php 5.4. I just built this box a few days ago, so (not being a php guy) I assumed it would come with a reasonably current version of…. stuff.

    The wp sites that I’ll be porting are all working on php 5.3.

    So my concern is that php 7.x might break them….?

    And also, I was able to write a short php script that was able to connect to the db.

    So, I’m wondering if the fcgi handler needs some loving in order to be able to connect to the db.

    Any thoughts on this?

    Thanks again,

    Mike.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    WordPress technically will run on 5.2, but only the 5.6 and 7 trees are still supported by the PHP developers.

    If the issue is FCGI, you may have php-fpm misconfigured.

    This is not really a WP issue; it’s sysadmin stuff. If you pop over to the IRC channel, there are several folks who can either help with getting your php properly configured or refer you to more specific channels like httpd and php for more detailed stuff.

    In my case I had moved the site from another server.

    In the .htaccess file in public_html there was a section starting

    # Wordfence WAF and ending # END Wordfence WAF.

    I removed that section from .htaccess and the site came back to life.

    I stored a copy of the original .htaccess on my hard drive, just in case.

    Went back, deleted Wordfence, then Added it back to the site, and it is good now.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Your PHP installation appears to be missing the MySQL extension which is require’ is closed to new replies.