PHP启动:运行单元测试时无法加载动态库 [英] PHP Startup: Unable to load dynamic library, when running unit tests
问题描述
当我尝试运行单元测试时,出现此错误
when I try to run my unit tests, I get this error
PHP警告:PHP启动:无法加载动态库'bz2'(尝试:\ xampp \ php \ ext \ bz2(找不到指定的模块.),\ xampp \ php \ ext \ php_bz2.dll(找不到指定的模块.)在第0行的Unknown中,PHP警告:PHP启动:无法动态加载库'curl'(尝试:\ xampp \ php \ ext \ curl(指定的模块可以找不到.),\ xampp \ php \ ext \ php_curl.dll(指定的模块找不到).)在第0行上的未知PHP警告:PHP启动:无法加载动态库"fileinfo"(尝试:\ xampp \ php \ ext \ fileinfo(找不到指定的模块.),\ xampp \ php \ ext \ php_fileinfo.dll(指定的模块不能为在第0行的Unknown中找到))PHP警告:PHP启动:无法加载动态库'gd2'(尝试:\ xampp \ php \ ext \ gd2(指定找不到模块.),\ xampp \ php \ ext \ php_gd2.dll(指定找不到).)在第0行PHP中的未知"中警告:PHP启动:无法加载动态库"gettext"(尝试:\ xampp \ php \ ext \ gettext(找不到指定的模块.),\ xampp \ php \ ext \ php_gettext.dll(指定的模块不能是在第0行的Unknown中找到))PHP警告:PHP启动:无法加载动态库'mbstring'(尝试:\ xampp \ php \ ext \ mbstring(找不到指定的模块.),\ xampp \ php \ ext \ php_mbstring.dll(找不到指定的模块.)在PHP 0行上未知警告:PHP启动:无法加载动态库'exif'(尝试:\ xampp \ php \ ext \ exif(找不到指定的模块.),\ xampp \ php \ ext \ php_exif.dll(指定的模块不能为在第0行的Unknown中找到))PHP警告:PHP启动:无法加载动态库'mysqli'(尝试:\ xampp \ php \ ext \ mysqli(找不到指定的模块.),\ xampp \ php \ ext \ php_mysqli.dll(找不到指定的模块.)在PHP 0行上未知警告:PHP启动:无法加载动态库"pdo_mysql"(尝试:\ xampp \ php \ ext \ pdo_mysql(指定的模块不能是找到.),\ xampp \ php \ ext \ php_pdo_mysql.dll(指定的模块可以找不到).)在第0行上的Unknown中PHP警告:PHP启动:无法加载动态库'pdo_sqlite'(尝试:\ xampp \ php \ ext \ pdo_sqlite(指定的模块无法找到.),\ xampp \ php \ ext \ php_pdo_sqlite.dll(指定的模块不能为在第0行的Unknown中找到))PHP警告:PHP启动:无法加载动态库'php_openssl.dll'(尝试:\ xampp \ php \ ext \ php_openssl.dll(指定的模块不能为找到.),\ xampp \ php \ ext \ php_php_openssl.dll.dll(指定的模块找不到).)在第0行上的未知PHP警告:PHP启动:无法加载动态库"php_ftp.dll"(尝试:\ xampp \ php \ ext \ php_ftp.dll(找不到指定的模块.),\ xampp \ php \ ext \ php_php_ftp.dll.dll(指定的模块不能为找到))),位于第0行PHP上的未知"中警告:无法打开'\ xampp \ php \ extras \ browscap.ini",用于读取第0行上的未知"
PHP Warning: PHP Startup: Unable to load dynamic library 'bz2' (tried: \xampp\php\ext\bz2 (The specified module could not be found.), \xampp\php\ext\php_bz2.dll (The specified module could not be found.)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: \xampp\php\ext\curl (The specified module could not be found.), \xampp\php\ext\php_curl.dll (The specified module could not be found.)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'fileinfo' (tried: \xampp\php\ext\fileinfo (The specified module could not be found.), \xampp\php\ext\php_fileinfo.dll (The specified module could not be found.)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'gd2' (tried: \xampp\php\ext\gd2 (The specified module could not be found.), \xampp\php\ext\php_gd2.dll (The specified module could not be found.)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'gettext' (tried: \xampp\php\ext\gettext (The specified module could not be found.), \xampp\php\ext\php_gettext.dll (The specified module could not be found.)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'mbstring' (tried: \xampp\php\ext\mbstring (The specified module could not be found.), \xampp\php\ext\php_mbstring.dll (The specified module could not be found.)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'exif' (tried: \xampp\php\ext\exif (The specified module could not be found.), \xampp\php\ext\php_exif.dll (The specified module could not be found.)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: \xampp\php\ext\mysqli (The specified module could not be found.), \xampp\php\ext\php_mysqli.dll (The specified module could not be found.)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: \xampp\php\ext\pdo_mysql (The specified module could not be found.), \xampp\php\ext\php_pdo_mysql.dll (The specified module could not be found.)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: \xampp\php\ext\pdo_sqlite (The specified module could not be found.), \xampp\php\ext\php_pdo_sqlite.dll (The specified module could not be found.)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'php_openssl.dll' (tried: \xampp\php\ext\php_openssl.dll (The specified module could not be found.), \xampp\php\ext\php_php_openssl.dll.dll (The specified module could not be found.)) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'php_ftp.dll' (tried: \xampp\php\ext\php_ftp.dll (The specified module could not be found.), \xampp\php\ext\php_php_ftp.dll.dll (The specified module could not be found.)) in Unknown on line 0 PHP Warning: Cannot open '\xampp\php\extras\browscap.ini' for reading in Unknown on line 0
警告:PHP启动:无法加载动态库'bz2'(尝试:\ xampp \ php \ ext \ bz2(找不到指定的模块.),\ xampp \ php \ ext \ php_bz2.dll(找不到指定的模块.)在第0行上的未知"中
Warning: PHP Startup: Unable to load dynamic library 'bz2' (tried: \xampp\php\ext\bz2 (The specified module could not be found.), \xampp\php\ext\php_bz2.dll (The specified module could not be found.)) in Unknown on line 0
警告:PHP启动:无法加载动态库"curl"(尝试:\ xampp \ php \ ext \ curl(找不到指定的模块.),\ xampp \ php \ ext \ php_curl.dll(指定的模块不能是找到).)在第0行上的未知"中
Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: \xampp\php\ext\curl (The specified module could not be found.), \xampp\php\ext\php_curl.dll (The specified module could not be found.)) in Unknown on line 0
警告:PHP启动:无法加载动态库'fileinfo'(尝试:\ xampp \ php \ ext \ fileinfo(指定的模块不能为找到.),\ xampp \ php \ ext \ php_fileinfo.dll(指定的模块可以找不到).)在第0行的未知"中
Warning: PHP Startup: Unable to load dynamic library 'fileinfo' (tried: \xampp\php\ext\fileinfo (The specified module could not be found.), \xampp\php\ext\php_fileinfo.dll (The specified module could not be found.)) in Unknown on line 0
警告:PHP启动:无法加载动态库'gd2'(尝试:\ xampp \ php \ ext \ gd2(找不到指定的模块.),\ xampp \ php \ ext \ php_gd2.dll(找不到指定的模块.)在第0行上的未知"中
Warning: PHP Startup: Unable to load dynamic library 'gd2' (tried: \xampp\php\ext\gd2 (The specified module could not be found.), \xampp\php\ext\php_gd2.dll (The specified module could not be found.)) in Unknown on line 0
警告:PHP启动:无法加载动态库"gettext"(尝试:\ xampp \ php \ ext \ gettext(找不到指定的模块.),\ xampp \ php \ ext \ php_gettext.dll(指定的模块不能是找到).)在第0行上的未知"中
Warning: PHP Startup: Unable to load dynamic library 'gettext' (tried: \xampp\php\ext\gettext (The specified module could not be found.), \xampp\php\ext\php_gettext.dll (The specified module could not be found.)) in Unknown on line 0
警告:PHP启动:无法加载动态库'mbstring'(尝试:\ xampp \ php \ ext \ mbstring(指定的模块不能是找到.),\ xampp \ php \ ext \ php_mbstring.dll(指定的模块可以找不到).)在第0行的未知"中
Warning: PHP Startup: Unable to load dynamic library 'mbstring' (tried: \xampp\php\ext\mbstring (The specified module could not be found.), \xampp\php\ext\php_mbstring.dll (The specified module could not be found.)) in Unknown on line 0
警告:PHP启动:无法加载动态库'exif'(尝试:\ xampp \ php \ ext \ exif(找不到指定的模块.),\ xampp \ php \ ext \ php_exif.dll(指定的模块不能为找到).)在第0行上的未知"中
Warning: PHP Startup: Unable to load dynamic library 'exif' (tried: \xampp\php\ext\exif (The specified module could not be found.), \xampp\php\ext\php_exif.dll (The specified module could not be found.)) in Unknown on line 0
警告:PHP启动:无法加载动态库'mysqli'(尝试:\ xampp \ php \ ext \ mysqli(找不到指定的模块.),\ xampp \ php \ ext \ php_mysqli.dll(指定的模块不能是找到).)在第0行上的未知"中
Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: \xampp\php\ext\mysqli (The specified module could not be found.), \xampp\php\ext\php_mysqli.dll (The specified module could not be found.)) in Unknown on line 0
警告:PHP启动:无法加载动态库'pdo_mysql'(尝试:\ xampp \ php \ ext \ pdo_mysql(指定的模块不能是找到.),\ xampp \ php \ ext \ php_pdo_mysql.dll(指定的模块可以找不到).)在第0行的未知"中
Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: \xampp\php\ext\pdo_mysql (The specified module could not be found.), \xampp\php\ext\php_pdo_mysql.dll (The specified module could not be found.)) in Unknown on line 0
警告:PHP启动:无法加载动态库'pdo_sqlite'(尝试:\ xampp \ php \ ext \ pdo_sqlite(指定的模块不能是找到.),\ xampp \ php \ ext \ php_pdo_sqlite.dll(指定的模块可以找不到).)在第0行的未知"中
Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: \xampp\php\ext\pdo_sqlite (The specified module could not be found.), \xampp\php\ext\php_pdo_sqlite.dll (The specified module could not be found.)) in Unknown on line 0
警告:PHP启动:无法加载动态库'php_openssl.dll'(尝试:\ xampp \ php \ ext \ php_openssl.dll(指定的模块无法被找到.),\ xampp \ php \ ext \ php_php_openssl.dll.dll(指定找不到模块.))在第0行的未知中
Warning: PHP Startup: Unable to load dynamic library 'php_openssl.dll' (tried: \xampp\php\ext\php_openssl.dll (The specified module could not be found.), \xampp\php\ext\php_php_openssl.dll.dll (The specified module could not be found.)) in Unknown on line 0
警告:PHP启动:无法加载动态库'php_ftp.dll'(尝试:\ xampp \ php \ ext \ php_ftp.dll(指定的模块不能为找到.),\ xampp \ php \ ext \ php_php_ftp.dll.dll(指定的模块找不到).)在第0行上的未知"中
Warning: PHP Startup: Unable to load dynamic library 'php_ftp.dll' (tried: \xampp\php\ext\php_ftp.dll (The specified module could not be found.), \xampp\php\ext\php_php_ftp.dll.dll (The specified module could not be found.)) in Unknown on line 0
有人可以帮我吗?谢谢.在PHPstorm中运行,Win 10
Could somebody help me ? Thanks. Running in PHPstorm, Win 10
推荐答案
您可能需要编辑 php.ini
文件并重新启动服务器.在 php.ini
配置中添加绝对路径.它适用于我的Windows 8.1机器中的xampp服务器.
示例: extension_dir ="\ xampp \ php \ ext"
到 extension_dir ="C:\ xampp \ php \ ext"
参考:
You may need to edit your php.ini
file and restart the server. Add absolute paths in php.ini
configuration. It worked for xampp server in my windows 8.1 machine.
example:
extension_dir="\xampp\php\ext"
to
extension_dir="C:\xampp\php\ext"
Reference: How to fix PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_curl.dll'?
这篇关于PHP启动:运行单元测试时无法加载动态库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!