PHP PDO扩展不可用的命​​令行 [英] PHP PDO extension not available is command line

查看:152
本文介绍了PHP PDO扩展不可用的命​​令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从WAMP搬到的EasyPHP现在也有使用PDO的问题。
PDO正常工作时,我认为在浏览器中的网站,但在cmd中不能正常工作或当我运行通过Netbeans的测试文件。
我得到:

I've moved from WAMP to EasyPHP and now there are problems using PDO. PDO works fine when I view the site in the browser, but doesn't work in cmd or when I run the test file via Netbeans. I get:

PDOException:找不到驱动程序

"PDOException: could not find driver"

的phpinfo()的配置命令我有

cscript /nologo configure.js " --enable-snapshot-build" " --disable-isapi" " --enable-debug-pack" " --disable-isapi" " --without-mssql" " --without-pdo-mssql" " --without-pi3web" " --with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk, shared" " --with-oci8=D:\php-sdk\oracle\instantclient10\sdk, shared" " --with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk, shared" " --enable-object-out-dir=../obj/" " --enable-com-dotnet" " --with-mcrypt=static" " --disable-static-analyze"

的php.ini 我已经注释掉这些行:

In php.ini I have already uncommented these lines:

extension=php_pdo_mysql.dll

extension=php_mysql.dll

我如何能得到这个工作任何想法?

Any ideas on how I can get this working?

推荐答案

在命令行运行PHP,你可以使用 -c - PHP-INI 参数为指向的php.ini 文件来使用。这将允许你使用一个php.ini文件两种。您也可以别名 PHP PHP -c /路径/要/ php.ini中如果您运行自己的脚本

When running php from the command line, you can use the -c or --php-ini argument to point to the php.ini file to use. This will allow you to use one php.ini file for both. You can also alias php to php -c/path/to/php.ini if you are running the script yourself.

这篇关于PHP PDO扩展不可用的命​​令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆