【发布时间】:2009-09-21 12:51:39
【问题描述】:
我想通过 PHP 命令行使用 PDO。 它可以通过 PHP Web API 完美运行,但不能通过命令行运行。
但是当我执行命令时:php test.php,它说unknown class PDO。
我认为这与线程安全差异有关。 因为,当我执行上述命令时,会出现以下警告:-
F:\shema\htdocs>php test.php
PHP Warning: PHP Startup: soap: Unable to initialize module
Module compiled with module API=20060613, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: sockets: Unable to initialize module
Module compiled with module API=20060613, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: mysql: Unable to initialize module
Module compiled with module API=20060613, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20060613, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: pdo_pgsql: Unable to initialize module
Module compiled with module API=20060613, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=1
These options need to match
in Unknown on line 0
PHP Fatal error: Class 'PDO' not found in F:\shema\htdocs\test.php on line 2
- PHP版本:5.2.9-2,下载自 here。
- 操作系统:Windows Vista
如果问题出在模块上,我从哪里获得这些模块的线程安全模块?
【问题讨论】:
标签: php command-line pdo