[英]“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
“pdo_mysql” is disabled and I can't get it enabled. “ pdo_mysql”已禁用,我无法将其启用。 I have MAMP v. 3.0.4 installed on my iMac 7.1 OSX 10.6.8.
我在iMac 7.1 OSX 10.6.8上安装了MAMP 3.0.4版。 On my phpinfo page I can see that the only PDO enabled is sqlite.
在我的phpinfo页面上,我可以看到唯一启用的PDO是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).
如果我查看我的php(5.5.10)扩展文件夹,则可以看到pdo_mysql.so文件(以及以.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.
但是,如果我转到php.ini文件,则扩展文件夹路径和extension = pdo_mysql.so都存在并且正确。 It feels like maybe my Mac is using another php.ini file but how do I find that out?
感觉好像我的Mac正在使用另一个php.ini文件,但如何找到呢? Does anyone have any tips on how I can get the PDO enabled?
是否有人对我如何启用PDO有任何提示?
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".
原来php.ini指向一个不存在的“扩展目录”。 Create a phpinfo() file and look at the value of this field:
创建一个phpinfo()文件,然后查看此字段的值:
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(). 我注意到在mamp php安装文件夹中有一个no-debug-non-zts-20131226文件夹,该文件夹与phpinfo()中显示的值不同。 What I did was to clone this folder and changed the name to the value of the phpinfo().
我要做的是克隆此文件夹,并将名称更改为phpinfo()的值。 Probably you could modify the php.ini file but I didn't want to.
可能您可以修改php.ini文件,但我不想这样做。
Hope this helps. 希望这可以帮助。
In my case I was using PHP 5.4 but the value in the php.ini was pointing to the extensions folder of PHP 5.5. 就我而言,我使用的是PHP 5.4,但php.ini中的值指向PHP 5.5的扩展文件夹。 I simply changed the php.ini settings and restarted MAMP.
我只是更改了php.ini设置并重新启动了MAMP。
php.ini php.ini中
extension_dir = "/Applications/MAMP/bin/php/php5.4.34/lib/php/extensions/no-debug-non-zts-20100525"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.