Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

Debian/UbuntuにMariaDB入れた時のphp5-mysqlについて

More than 5 years have passed since last update.

背景

Debian/Ubuntuの場合、標準パッケージのphp5-mysqlではライブラリとヘッダに差異がある為に、mysql_connect()などでエラー表示されてしまいます。

バージョンの確認方法

$ php -i | grep Client
Client API version => 10.0.14-MariaDB
Client API library version => 10.0.14-MariaDB
Client API header version => 5.5.38
Client API version => 10.0.14-MariaDB

Client API headerがMySQLの5.5.38のままで残る。

回避方法

こちらのページを参考に、とりあえず回避できました。
http://www.pontikis.net/blog/is-it-time-to-remove-mysql-in-favor-of-mariadb-in-production-servers

error_reporting(0);
$conn = mysql_connect('params');
error_reporting('YOUR SETTINGS');
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away