Firebird php无法找到主机

编程入门 行业动态 更新时间:2024-10-04 07:19:05
本文介绍了Firebird php无法找到主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我尝试对Firebird数据库运行 ibase_connect .

I try to run an ibase_connect to an firebird database.

数据库不在我的本地主机上.它运行在网络Windows服务器上.

我也有Windows,并且已连接到共享文件夹:

I have windows too and have an connection to the shared folder:

Z:\ Folder_WITH_DB.

我安装了XAMPP

  • ibase扩展
  • pdo firebird扩展.

我将 fbclient.dll 复制到了我的 XAMPP/php 文件夹中.

I copied the fbclient.dll into my XAMPP/php folder.

但是如果我运行这段代码:

But if i run this code:

$db = 'Z:/Folder_WITH_DB/database.fdb'; $username='SYSDBA'; $password='masterkey'; $dbh = ibase_connect ( $db, $username, $password ) or die ("error in db connect");

给出此错误

Warning: ibase_connect(): Unable to complete network request to host "Z". Failed to locate host machine. in xxx/index.php on line xx

firebird.log :

INET/INET_connect: gethostbyname (Z) failed, error code = 11004

我在本地主机和服务器上的服务文件中添加了 gds_db 3050/tcp (均已重新启动),这是相同的错误.

I added gds_db 3050/tcp to the service file on my localhost and the server (have restarted both) and it is the same error.

Windows防火墙在服务器上被禁用.火鸟服务器和火鸟监护人的服务正在运行.

Windows Firewall is deactivated on server. Service for firebird server and firebird guardian is running.

推荐答案

Firebird只能使用数据库服务器本地的数据库文件.您无法连接到网络共享上的Firebird数据库*.您需要连接到Firebird服务器.

Firebird can only use a database file local to the database server. You can't connect to a Firebird database on a network share*. You need to connect to the Firebird server instead.

因此,如果"Z:/Folder_WITH_DB/database.fdb"的数据库位于服务器firebirdsrv中的文件夹D:\ data \ database.fdb中,则您需要连接到 firebirdsrv/3050:D:\ data\ database.fdb .我强烈建议删除网络共享.

So if the database of 'Z:/Folder_WITH_DB/database.fdb' is on server firebirdsrv in folder D:\data\database.fdb, then you need to connect to firebirdsrv/3050:D:\data\database.fdb. I strongly suggest to remove the networkshare.

*:从技术上讲,可以使用共享,但是默认情况下它是禁用的,因为通过网络共享从多台服务器访问数据库可能会破坏数据库.

*: Technically a share can be used, but it is disabled by default because accessing a database from multiple servers through a network share can corrupt a database.

更多推荐

Firebird php无法找到主机

本文发布于:2023-11-02 06:44:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551652.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:主机   Firebird   php

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!