作为脚本运行时缺少 DLL

发布于 2024-09-12 09:13:18 字数 856 浏览 5 评论 0原文

我试图让 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

单身情人 2024-09-19 09:13:18

当我在 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”解决了这个问题,

例如

; at bottom of php.ini -->>
[PHP_BZ2]
extension=php_bz2.dll
[PHP_CURL]
extension=php_curl.dll
[PHP_ENCHANT]
extension=php_enchant.dll
[PHP_FILEINFO]
extension=php_fileinfo.dll
[PHP_GD2]
extension=php_gd2.dll
[PHP_GETTEXT]
extension=php_gettext.dll
[PHP_GMP]
extension=php_gmp.dll
[PHP_IMAP]
extension=php_imap.dll
[PHP_INTL]
extension=php_intl.dll
[PHP_LDAP]
extension=php_ldap.dll
[PHP_MBSTRING]
extension=php_mbstring.dll
[PHP_MYSQL]
extension=php_mysql.dll
[PHP_MYSQLI]
extension=php_mysqli.dll
;[PHP_OCI8]
;extension=php_oci8.dll
;[PHP_OCI8_11G]
;extension=php_oci8_11g.dll
[PHP_OPENSSL]
extension=php_openssl.dll
[PHP_PDO_MYSQL]
extension=php_pdo_mysql.dll
;[PHP_PDO_OCI]
;extension=php_pdo_oci.dll
[PHP_PDO_ODBC]
extension=php_pdo_odbc.dll
[PHP_PDO_PGSQL]
extension=php_pdo_pgsql.dll
[PHP_PDO_SQLITE]
extension=php_pdo_sqlite.dll
[PHP_PGSQL]
extension=php_pgsql.dll
[PHP_SHMOP]
extension=php_shmop.dll
[PHP_SNMP]
extension=php_snmp.dll
[PHP_SOAP]
extension=php_soap.dll
[PHP_SOCKETS]
extension=php_sockets.dll
[PHP_SQLITE]
extension=php_sqlite.dll
[PHP_SQLITE3]
extension=php_sqlite3.dll
;[PHP_SYBASE_CT]
;extension=php_sybase_ct.dll
[PHP_TIDY]
extension=php_tidy.dll
[PHP_XMLRPC]
extension=php_xmlrpc.dll
[PHP_XSL]
extension=php_xsl.dll
[PHP_EXIF]
extension=php_exif.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

; at bottom of php.ini -->>
[PHP_BZ2]
extension=php_bz2.dll
[PHP_CURL]
extension=php_curl.dll
[PHP_ENCHANT]
extension=php_enchant.dll
[PHP_FILEINFO]
extension=php_fileinfo.dll
[PHP_GD2]
extension=php_gd2.dll
[PHP_GETTEXT]
extension=php_gettext.dll
[PHP_GMP]
extension=php_gmp.dll
[PHP_IMAP]
extension=php_imap.dll
[PHP_INTL]
extension=php_intl.dll
[PHP_LDAP]
extension=php_ldap.dll
[PHP_MBSTRING]
extension=php_mbstring.dll
[PHP_MYSQL]
extension=php_mysql.dll
[PHP_MYSQLI]
extension=php_mysqli.dll
;[PHP_OCI8]
;extension=php_oci8.dll
;[PHP_OCI8_11G]
;extension=php_oci8_11g.dll
[PHP_OPENSSL]
extension=php_openssl.dll
[PHP_PDO_MYSQL]
extension=php_pdo_mysql.dll
;[PHP_PDO_OCI]
;extension=php_pdo_oci.dll
[PHP_PDO_ODBC]
extension=php_pdo_odbc.dll
[PHP_PDO_PGSQL]
extension=php_pdo_pgsql.dll
[PHP_PDO_SQLITE]
extension=php_pdo_sqlite.dll
[PHP_PGSQL]
extension=php_pgsql.dll
[PHP_SHMOP]
extension=php_shmop.dll
[PHP_SNMP]
extension=php_snmp.dll
[PHP_SOAP]
extension=php_soap.dll
[PHP_SOCKETS]
extension=php_sockets.dll
[PHP_SQLITE]
extension=php_sqlite.dll
[PHP_SQLITE3]
extension=php_sqlite3.dll
;[PHP_SYBASE_CT]
;extension=php_sybase_ct.dll
[PHP_TIDY]
extension=php_tidy.dll
[PHP_XMLRPC]
extension=php_xmlrpc.dll
[PHP_XSL]
extension=php_xsl.dll
[PHP_EXIF]
extension=php_exif.dll

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

睫毛溺水了 2024-09-19 09:13:18

我通过更改脚本以某种方式解决了这个问题。现在是:

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.

雨夜星沙 2024-09-19 09:13:18

通过从命令行运行 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

故事和酒 2024-09-19 09:13:18

我运行了 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.

伴随着你 2024-09-19 09:13:18

我是否正确地认为 C:\instantclient_11_2C:\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 and C:\oracle\ora92\bin contain a OCI.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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文