Search code examples
phphomebrewmysqlnd

Missing mysql api extension in mysqlnd driver


I have a variant of this question.

Everything was working fine on my development machine (Mac) but I had to reinstall php with homebrew because I needed the '--with-homebrew-curl' option. PHP got updated from 5.6.18 to 5.6.30. Now the old mysql functions like mysql_connect() aren't working any more, alas they are gone like as if I was using PHP 7, which I'm not. I have looked at phpinfo and see that under 'mysqlnd'->'API Extensions' it says only 'pdo_mysql,mysqli'. On my production server (where php hasn't been installed with homebrew) it says 'mysql,mysqli,pdo_mysql' and there is an own mysql section.

What has happened to the mysql-support in mysqlnd on my development machine? Can it be because it php went from 5.6.18 to 5.6.30? Can I force homebrew to install 5.6.18? Is it possible to "unlock" mysql in mysqlnd?


Solution

  • Yes, I had added extension=mysql.so in my php.ini, but it turned out that the mysql.so file was not in my extension folder nor anywhere else on my machine. Solved this by downloading the php source and building the extension manually and then copying it into the extension folder.

    I have also added this answer to the one @cale_b found so that this one could be closed.