"pdo_mysql"已禁用,我无法将其启用.我在iMac 7.1 OSX 10.6.8上安装了MAMP 3.0.4版

问题描述:

"pdo_mysql"已禁用,我无法将其启用.我在iMac 7.1 OSX 10.6.8上安装了MAMP 3.0.4版.在我的phpinfo页面上,我可以看到唯一启用的PDO是sqlite.如果我查看php(5.5.10)扩展文件夹,则可以看到pdo_mysql.so文件(以及以.a结尾的文件).但是,如果我转到php.ini文件,则扩展文件夹路径和extension = pdo_mysql.so都存在并且正确.感觉好像我的Mac正在使用另一个php.ini文件,但是如何找到呢?有人对我如何启用PDO有任何提示吗?

"pdo_mysql" is disabled and I can't get it enabled. I have MAMP v. 3.0.4 installed on my iMac 7.1 OSX 10.6.8. On my phpinfo page I can see that the only PDO enabled is sqlite. If I look in my php (5.5.10) extensions folder I do see the pdo_mysql.so file (as well as one ending with .a). But if I go to the php.ini file the both the extensions folder path and the extension=pdo_mysql.so are there and correct. It feels like maybe my Mac is using another php.ini file but how do I find that out? Does anyone have any tips on how I can get the PDO enabled?

整个周末,我一直在为此苦苦挣扎,终于解决了.原来php.ini指向不存在的扩展目录".创建一个phpinfo()文件,然后查看此字段的值:

I've been struggling with this the whole weekend and finally solved it. Turns out that the php.ini is pointing to a non-existing "extensions dir". Create a phpinfo() file and look at the value of this field:

我注意到在mamp php安装文件夹中有一个no-debug-non-zts-20131226文件夹,该文件夹与phpinfo()中显示的值不同.我要做的是克隆此文件夹,并将名称更改为phpinfo()的值.可能您可以修改php.ini文件,但我不想这么做.

I noticed that in the mamp php installed folder there is a no-debug-non-zts-20131226 folder, which is different from the value shown in the phpinfo(). What I did was to clone this folder and changed the name to the value of the phpinfo(). Probably you could modify the php.ini file but I didn't want to.

希望这会有所帮助.