简体   繁体   English

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

[英]“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()文件,然后查看此字段的值: 中extensions_dir

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-201005‌​25"

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

相关问题 Amazon AMI PDO MYSQL驱动程序丢失。 没有适用于PHP 7.1的软件包。 如何安装7.1 PDO_MYSQL驱动程序? - Amazon AMI PDO MYSQL driver missing. No package is available for PHP 7.1. How can I install the 7.1 PDO_MYSQL driver? Ubuntu 12.04上的Apache2:mysqlnd + mysqli和pdo_mysql-我可以同时使用吗? - Apache2 on Ubuntu 12.04: mysqlnd+mysqli and pdo_mysql - can i have both? 尽管已安装pdo_mysql,但我的Laravel应用程序中出现PDOException - PDOException in my Laravel application, despite having pdo_mysql installed PDO_mysql无法与doctrine2和MAMP一起使用 - PDO_mysql not working with doctrine2 and MAMP 如何在application.ini文件中定义PDO_MYSQL - How can i define PDO_MYSQL in application.ini file phpinfo()与pdo_mysql的php-i不同 - phpinfo() different from php-i for pdo_mysql 如果我从 MAMP 安装它,我如何运行 mysql - how can I run mysql if I installed it from MAMP 如何判断是否安装/禁用了 PDO 模块? - How can I tell if PDO module installed/disabled? PDO_mysql驱动程序不起作用 - PDO_mysql driver doesn't work Docker 构建:扩展未通过 apk 加载:exif、gd、pdo_mysql、pecl-redis。 我该怎么做才能修复我的 dockerfile? 来自 php:7.4-fpm-alpine - Docker build: Extentions not loading via apk: exif, gd, pdo_mysql, pecl-redis. What can I do to fix my dockerfile? From php:7.4-fpm-alpine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM