简体   繁体   English

mysqlnd驱动程序中缺少mysql API扩展

[英]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. 一切在我的开发机(Mac)上都可以正常运行,但是我必须使用homebrew重新安装php,因为我需要使用'--with-homebrew-curl'选项。 PHP got updated from 5.6.18 to 5.6.30. PHP从5.6.18更新到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. 现在像mysql_connect()这样的旧mysql函数不再起作用了,可惜好像我使用的是PHP 7一样,它们消失了。 I have looked at phpinfo and see that under 'mysqlnd'->'API Extensions' it says only 'pdo_mysql,mysqli'. 我看过phpinfo,发现在“ mysqlnd”->“ API Extensions”下它只显示“ 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. 在我的生产服务器上(未通过自制软件安装php)上显示“ mysql,mysqli,pdo_mysql”,并且有一个自己的mysql部分。

What has happened to the mysql-support in mysqlnd on my development machine? 开发机器上mysqlnd中的mysql-support发生了什么情况? Can it be because it php went from 5.6.18 to 5.6.30? 是因为它的php从5.6.18变为5.6.30吗? Can I force homebrew to install 5.6.18? 我可以强迫自制软件安装5.6.18吗? Is it possible to "unlock" mysql in mysqlnd? 是否可以在mysqlnd中“解锁” mysql?

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. 是的,我在php.ini中添加了extension = mysql.so,但是事实证明mysql.so文件不在我的扩展文件夹中,也不在我的计算机上的任何其他位置。 Solved this by downloading the php source and building the extension manually and then copying it into the extension folder. 通过下载php源代码并手动构建扩展程序,然后将其复制到扩展程序文件夹中来解决此问题。

I have also added this answer to the one @cale_b found so that this one could be closed. 我还将此答案添加到找到的一个@cale_b中,以便可以关闭该答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM