Comments - Installation Issues with PHP5

11 years, 5 months ago 家植 董

如PHP5用旧的方法链接将导致如下错误:

'mysql_connect(): Headers and client library minor version mismatch. Headers:50156 Library:50206'

这是因为库错误检查————其要求客户端的库版本与PHP编译时的版本一致导致的。如果你想通过升级MySQL库而不同时升级PHP库将导致同样的错误。请参看怎样使PHP5 mysql与mariadb客户端API版本一致

修复此错误的方法:

  1. 改用PHP的mysqlnd驱动(推荐使用);
  2. 使用更低的错误报告级别
    $err_level = error_reporting(0);
    $conn = mysql_connect('params');
    error_reporting($err_level); 
    
  3. 用MariaDB客户端库重新编译PHP;R
  4. 在MariaDB中使用MySQL原来的客户端库。
 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.