ibase_service_attach doesn't allow local connection to Services API
Function ibase_service_attach always use the connection pattern "%s:service_mgr" which initiates TCP/IP connection. However for local connection it must be "service_mgr". Possible solution: to check if parameter $host is empty to use the pattern for local connection.
@avp-novgorod what exactly is the problem here? I've tried
ibase_service_attach("", $user, $password);
$fb_version_str = ibase_server_info($se, IBASE_SVC_SERVER_VERSION);
Works for me. No running server instances.
Which version of fbclient.dll do you use in php?
I have test embebbed fbclient.dll 2.0.7 for Windows and get error:
ibase_service_attach(): Unable to complete network request to host "AVP". Failed to establish a connection.
where AVP is my computer name.
Where did you get that?
From this package and then renamed fbembed.dll to fbclient.dll?
What PHP version you are using? PHP 7.3 / 8.4 gives me this error when using with embeded.dll
From this package and then renamed fbembed.dll to fbclient.dll?
Yes, exactly.
I test with php 8.2
The function fb_get_master_interface arises in 3.0 fbclient.dll
What do you get from php -i | grep "Run-time Client Library Version"
It feels like you are using more recent fbclient than 2.0.7
Is not clear which php module strongly requires function fb_get_master_interface at your php-config. By default php-firebird and php-pdo work fine with Firebird 2.0 client dll.
Can you please check php -i output about FB client libs? Or phpinfo() from web?
Core
PHP Version 8.2.3
interbase
Firebird/InterBase Support dynamic
Interbase extension version 3.0.1
Compile-time Client Library Version Firebird API version 30
Run-time Client Library Version WI-V6.3.7.13318 Firebird 2.0
PDO
PDO support enabled
PDO drivers firebird
PDO_Firebird
PDO Driver for Firebird enabled
Client Library Version WI-V6.3.7.13318 Firebird 2.0
Btw isc_service_attach() is even supposed to work with embedded?
Yes, should work. In old version there was an fbembed.dll for that. Now we only have fbclient.dll (.so on Linux)
fb_get_master_interface() is comming from fbclient3 and onwards. If needed support for 2.0.x it has to be compiled against older 2.0.x client libraries. Not sure I want to deal with that now.
fb3+ isc_service_attach() indeed works in embed mode.
2.0 and 2.5 are EOL. So no need to work on that.
Local connection is not equal to embedded client. Pattern "%s:service_mgr" selects network access. However "service_mgr" select local connection to the server in same machine. It is not documented how isc_service_attach() will work with empty host.
fb_get_master_interface() is comming from fbclient3 and onwards.
Please clarify what module required new firebird interface ? Since which version?
I was actually used from extension itself. I added it when added support for new types. It is actually only needed #if FB_API_VER >= 40 so I already put it under a guard (dc2865358de80d29636b09ee9456518f72ef2afb). So now when compiling extension against FB client libs older than 4 this won't be used. At least at this moment.
Do you mean that by default FB3.0 is unsupported now?
No, I do not mean that. Just that some implementation details regarding Firebird 4.0+ needlessly leaked into 3.0 and 2.0. Don't worry about this.
@avp-novgorod could you test with RC.1?