Compiled PHP 7 missing mysql extension in WordPress

后端 未结 6 856
慢半拍i
慢半拍i 2020-12-15 05:51

I have built PHP 7 with a configuration that worked for a previous version of PHP. Now my WordPress websites get the message:

Your PHP installation a

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-15 06:23

    mysql_* functions got deleted in PHP 7.0 update your code to mysqli or PDO

    Also take a look at prepared statements if you are handling user input. To reduce the chance of SQL injections

    An example of mysqli connection string:

    connect_errno) {
        echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
    }
    ?>
    

    An example of pdo connection string:

     
    

    Note:

    That mysqli example handles a connection error

提交回复
热议问题