作为脚本运行时缺少 DLL
我试图让 PHP 脚本在我的服务器上每 30 分钟运行一次(Win XP SP3,xampp 1.7.3)。 为此,我使用 MS 任务计划程序运行以下脚本 (update.cmd)
SET PATH="C:\xampp\PHP"
start php.exe \htdocs\update_dashboard.php
,我在网络服务器上使用 oci8 php 扩展,但是当我运行该脚本时,它会出现 php.exe 无法找到的错误oci8 扩展必需的 dll。我收到以下错误:
<代码> 该应用程序无法启动,因为找不到 OCI.dll。重新安装应用程序可能会解决此问题。
PHP 启动:无法加载动态库 'C:\xampp\php\ext\php_oci8.dll' - 找不到指定的模块计数。
我知道该文件在那里,并且当 php 通过 apache 运行时我没有收到这些错误,我是否运行了错误的 php.exe 副本?有什么想法为什么不呢?我的 PATH 必须设置不同吗?我的 Windows 路径包括:
C:\instantclient_11_2;C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1。 8\bin;C:\Program Files\ActiveState Komodo Edit 5\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Altiris\Software Virtualization Agent\
感谢您的帮助。
I'm trying to get a PHP script to run every 30 minutes on my server (Win XP SP3, xampp 1.7.3).
To do so I'm running the following script (update.cmd) using the MS task scheduler
SET PATH="C:\xampp\PHP"
start php.exe \htdocs\update_dashboard.php
I am using the oci8 php extension on my webserver, but when I run that script it gives me errors that php.exe can't find the necessary dll for the oci8 extension. I get the following errors:
This application has failed to start because OCI.dll was not found. Re-installing the application may fix this problem.
PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_oci8.dll' - The specified module count not be found.
I know that the file is there and I don't get those errors when the php is run through apache, am I running the wrong copy of php.exe? Any ideas why not? Does my PATH have to be set differently? My Windows PATH includes:
C:\instantclient_11_2;C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\Program Files\ActiveState Komodo Edit 5\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Altiris\Software Virtualization Agent\
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
当我在 Windows 7 上从 php 5.3 非线程安全切换到 php 5.3 线程安全时,我发现了这个问题,并且我勾选了安装所有内容,
通过注释掉 extension=php_oci8.dll、extension=php_oci8_11g.dll、extension=php_pdo_oci 解决了该问题。 我还遇到了需要 libcs.dll的
sybase 扩展的问题,我通过删除“extension=php_sybase_ct.dll”解决了这个问题,
例如
猜测是否需要 sybase 和 oracle 数据库连接,标准客户端安装 oci.dll 和libcs.dll 在适当的位置,对于其他不需要使用这些数据库的人来说,只需禁用 php 扩展,它应该可以正常运行:)
Ant
I found this problem when I switch from php 5.3 non thread safe to php 5.3 thread safe on windows 7, and I ticked install everything
I fixed the issue by commenting out extension=php_oci8.dll, extension=php_oci8_11g.dll, extension=php_pdo_oci.dll in the php.ini
I also had issues with the sybase extension wanting a libcs.dll, which I solved by removing "extension=php_sybase_ct.dll"
eg
Guessing if you need sybase and oracle database connections the standard clients install oci.dll and libcs.dll in the appropriate places, for everyone else who doesn't need to use these dbs just disable the php extensions, and it should run fine :)
Ant
我通过更改脚本以某种方式解决了这个问题。现在是:
C:\xampp\PHP\php.exe -f C:\xampp\htdocs\php_scripts\utils\update_dashboard.php
感谢您的帮助。
I've solved the problem in a way by changing the script. It's now:
C:\xampp\PHP\php.exe -f C:\xampp\htdocs\php_scripts\utils\update_dashboard.php
Thanks for the help.
通过从命令行运行 phpinfo() 检查 php 使用的 php.ini 文件,并查看该文件中启用了哪些扩展。从命令行运行时,将 php 设置为使用不同的 php.ini 文件是很常见的; xampp 当然默认使用不同的 php.ini 文件。您还可以通过 -c 开关告诉它要使用哪个 php.ini 文件
Check the php.ini file that php is using by running a phpinfo() from the command line, and look to see what extensions are enabled in that file. It's quite commopn for php to be set to use a different php.ini file when running from the command line; and xampp certainly uses a different php.ini file by default. You can also tell it what php.ini file to use with the -c switch
我运行了 php -m 命令。结果发现我系统的 OCI.dll 已损坏或丢失。我通过在运行框中运行 sfc /scannow 来恢复它,重新启动,系统重新安装它,它已启动并运行,我的扩展现在全部正常工作。
I ran the php -m command. Turned out that my system's OCI.dll went either corrupt or missing. I recovered it by running sfc /scannow in the run box, rebooted, system reinstalled it, and it was up and running with my extensions now all working.
我是否正确地认为
C:\instantclient_11_2
和C:\oracle\ora92\bin
都包含OCI.DLL
?由于路径的顺序,您可能会加载错误的 dll。当我阅读 Which OCI8 DLL to use in PHP 5.3 时,你需要一个根据 oracle 客户端的版本,php.ini 中的行有所不同。我目前无法访问带有oracle的电脑,所以我无法验证这一点。Am I correct that both
C:\instantclient_11_2
andC:\oracle\ora92\bin
contain aOCI.DLL
? Because of the order of the path you might load the wrong dll. When I read Which OCI8 DLL to use in PHP 5.3 you need a different line in the php.ini depending on the version of the oracle client. I currently have no access to a pc with oracle, so I cannot verify this.