I've been having the same problem as you and here is the solution I have come up with. I'm running CentOS 6.3 with MariaDB 5.5 and was running PHP 5.4.11, but in this solution I reverted to PHP 5.4.10. I'm by no means a Linux guru, so take what I'm saying with a grain of salt.
I managed to get MariaDB working fine with MySQLi and no longer receive this error by uninstalling PHP through yum. I then reinstalled it using the instructions given here http://www.webtatic.com/packages/php54/. The version of PHP I was having troubles with was PHP 5.4.11, and the version given in the RPM provided at this instruction site is version 5.4.10, so I'm thinking an update that was made in the new release broke something.
So try installing PHP 5.4.10 anyway you want and see if that works for you, or use the instructions from that website if it's easier for you. Remember to include "yum install php54w-mysql" as one of the packages you install, as well as any other one you may desire.