为什么PHP PEAR报告它在Windows上找不到某些DLL?

时间:2022-11-28 07:13:58

I'm trying to do a system wide install of PEAR on my web server. When I execute go-pear.bat in the PHP installation folder from the command line I get the following error windows popping up:

我正在尝试在我的Web服务器上进行系统范围的PEAR安装。当我从命令行在PHP安装文件夹中执行go-pear.bat时,我会弹出以下错误窗口:

---------------------------
php.exe - Unable To Locate Component
---------------------------
This application has failed to start because php_mbstring.dll was not found. 
Re-installing the application may fix this problem. 

---------------------------
php.exe - Unable To Locate Component
---------------------------
This application has failed to start because php_pdo.dll was not found. 
Re-installing the application may fix this problem. 

I also see the following warnings emitted in the command line window by the script:

我还看到脚本在命令行窗口中发出以下警告:

PHP Warning:  PHP Startup: Unable to load dynamic library './ext/php_exif.dll' - The specified modul
e could not be found.
 in Unknown on line 0

All of these modules are configured in the php.ini file (which resides in the php install folder c:\php).

所有这些模块都在php.ini文件中配置(它位于php安装文件夹c:\ php中)。

They are also reported correctly by php_info().

它们也由php_info()正确报告。

I'm running PHP 5.2.6 Windows Non thread safe build on FastCGI on IIS6.

我在IIS6上运行PHP 5.2.6 Windows非线程安全版本的FastCGI。

Update:

I've also tried (as suggested by acrosman) setting extension_dir=c:\php and extension_dir=c:\php\ext but without success.

我也试过(按照acrosman的建议)设置extension_dir = c:\ php和extension_dir = c:\ php \ ext但没有成功。

I'm also remembering to kill the php-cgi.exe process (FastCGI keeps it alive) after each php.ini modification to force a re-read.

我还记得在每次php.ini修改之后杀死php-cgi.exe进程(FastCGI保持活着)以强制重新读取。

Update 2:

This looks like a PHP issue and not an issue with PEAR, running php.exe from the command line generates the same errors.

这看起来像一个PHP问题而不是PEAR的问题,从命令行运行php.exe会产生相同的错误。

2 个解决方案

#1


Solved. It turns out that php.exe needs to see the PHP extensions (c:\php\ext) folder in the system PATH.

解决了。事实证明,php.exe需要在系统PATH中看到PHP扩展(c:\ php \ ext)文件夹。

#2


Check to make you that the extension directory is properly set in you php.ini file. I suspect that it's set as being a relative path, and that setting is causing problems when running from the command line:

检查是否在php.ini文件中正确设置了扩展目录。我怀疑它被设置为相对路径,并且该设置在从命令行运行时导致问题:

extension_dir ="C:\PHP\ext"

#1


Solved. It turns out that php.exe needs to see the PHP extensions (c:\php\ext) folder in the system PATH.

解决了。事实证明,php.exe需要在系统PATH中看到PHP扩展(c:\ php \ ext)文件夹。

#2


Check to make you that the extension directory is properly set in you php.ini file. I suspect that it's set as being a relative path, and that setting is causing problems when running from the command line:

检查是否在php.ini文件中正确设置了扩展目录。我怀疑它被设置为相对路径,并且该设置在从命令行运行时导致问题:

extension_dir ="C:\PHP\ext"