我想通过PHP命令行使用PDO。--它通过PHP工作得很完美,但不是通过命令行.。
但是,当我执行命令: PDO时,它说的是未知类test.php。
我认为这与线程安全的差异有关。因为,当我执行上述命令时,会出现以下警告:
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如果问题在于模块,那么在哪里可以获得这些模块的线程安全模块呢?
发布于 2009-09-21 19:02:27
您的PHP和您的模块是用不同的线程安全性编译的(在PHP中打开"on“,在模块中”关闭“)。获取正确的非线程安全 (或"nts")构建的PHP以匹配您试图使用的模块,您的问题应该会得到解决。
发布于 2009-09-22 06:34:17
啊,您可以看到用模块API=20060613编译的模块,debug=0,用模块API=20060613、debug=0、thread-safety=1编译的
螺纹安全错配。你需要打开线程安全的。
发布于 2009-09-21 13:46:13
在您的extension_dir中定义php.ini时出错。试着把绝对的路径放在那里。
https://stackoverflow.com/questions/1454358
复制相似问题