Firebird php Failed to locate host machine

主宰稳场 提交于 2021-01-29 04:01:40

问题


I try to run an ibase_connect to an firebird database.

The database is NOT on my localhost. It run on an network windows server.

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

Z:\Folder_WITH_DB.

I have XAMPP installed with

  • ibase extension
  • pdo firebird extension.

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");

gives this error

 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

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 Firewall is deactivated on server. Service for firebird server and firebird guardian is running.


回答1:


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.

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.



来源:https://stackoverflow.com/questions/35861765/firebird-php-failed-to-locate-host-machine

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!