Windows 2003/XP 上的 Apache2、PHP5 和 Interbase/Firebird
我最近分别从 Apache 1.26 和 PHP 4.3 升级到 2.2.11 和 5.2.9。在我最初的设置中,我有一个计划任务设置为每周日运行以获取每周新闻通讯。它将连接到我的数据库(Interbase/Firebird),以了解下周将举办哪些活动,并获取电子邮件将发送到的地址列表。当然,我必须更改 PHP 任务的设置方式,因为命令行执行从版本 4 到版本 5 略有变化。一旦解决了这个问题,真正的问题就出现了。
现在,当从命令行执行任何脚本时,我无法连接到我的数据库。我从 ibase_errmsg
收到以下错误:无法完成对主机“localhost”的网络请求。无法找到主机。未定义服务 gds_db/tcp。
相同的脚本在浏览器中完美运行。此外,数据库连接代码在我的整个站点中用于登录、获取记录和更新记录。
如果有人知道为什么从命令行执行脚本时无法连接到数据库,请提供帮助。
I have recently upgraded from Apache 1.26 and PHP 4.3 to 2.2.11 and 5.2.9 respectively. With my original setup I had a scheduled task set to run every Sunday for a weekly newsletter. It would connect to my database (Interbase/Firebird) to find out what events were opening for the following week and get the list of addresses the email will be sent to. Of course, I had to change how PHP the task was setup since command line execution has changed slightly from version 4 to 5. Once that was fixed the real problem reared it's head.
Now when executing any script from the command line I cannot connect to my database. I receive the following error from ibase_errmsg
: Unable to complete network request to host "localhost". Failed to locate host machice. Undefined service gds_db/tcp.
The same script works perfectly from the browser. Also, the database connect code is used all through my site for logging in, getting records, and updating records.
If anyone has any idea why a script will not connect to the database when executed from the command line, please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对不起大家的帖子。我已经回答过这个问题了。我必须将 fbclient.dll 文件复制到 PHP 文件夹中并将其重命名为 gds32.dll。
有谁知道为什么我必须这样做才能仅执行命令行脚本,而不是在浏览器中运行的脚本?
Sorry for the post everyone. I have answered that question. I had to copy my fbclient.dll file in to my PHP folder and rename it gds32.dll.
Does anyone know why I had to do this for executing command line scripts only, and not for scripts that run in the browser?