Php - Your PHP installation appears to be missing the MySQL extension which is required by WordPress

前端 未结 25 1357
死守一世寂寞
死守一世寂寞 2020-11-28 08:48

How do I fix the error below?

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

I

25条回答
  •  甜味超标
    2020-11-28 09:19

    As few people shared to tick mark the checkbox for mysqli and mysqlind

    but Hostgator (webhosting site) now does not give that option to select extension via the cpanel as that option is removed select PHP and now it gives the option for php manager

    You can just select the Php version you want and not the extension.

    Solution :- Called the hostgator , first time they said get in touch with your developer, ( i asked my brother and he downloaded the files locally and verified it was working fine on local system) <-- this was not needed though

    Again called the hostgator and their backend team installed the missing extension and it was solved.

    Below is the code which gives this error when it does not find the extension and you can find this line in load.php via ftp.

    if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! extension_loaded( 'mysqlnd' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
        require_once ABSPATH . WPINC . '/functions.php';
        wp_load_translations_early();
        $args = array(
            'exit' => false,
            'code' => 'mysql_not_found',
        );
        wp_die(
            __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ),
            __( 'Requirements Not Met' ),
            $args
        );
        exit( 1 );
    }
    

    }

提交回复
热议问题