PHP PDO扩展不可用的命令行 [英] PHP PDO extension not available is command line
问题描述
我从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屋!