我想通過PHP命令行使用PDO。 它通過PHP web API完美工作,但不通過命令行。如何讓PHP命令行與PDO一起使用?
但是當我執行命令:php test.php,它說未知類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
如果問題與模塊,我在哪裏獲得這些模塊的線程安全模塊的?
沒有。這是絕對路徑。 extension_dir =「C:/php5.2.9/ext」 – Sabya