Subject SOLVED - [firebird-php] Trouble getting php-interbase to work with PHP 5.4 on CentOS 7
Author Paul Vinkenoog
Hi all,

> I've been struggling for days now to get php-interbase to work with PHP 5.4, without success.
>
> It concerns a freshly installed CentOS 7 server with Firebird 2.5.3 Superclassic. I can make local connections with isql (both TCP/IP and embedded) as well als outward connections to other systems.
>
> I can also connect from remote systems to Fb databases on the CentOS server, in as much as I configured the firewall to allow connections from those specific IP's.
>
> All this is just to say that it isn't a network or firewall issue.
>
> Firebird 2.5.3, php-5.4.16 and php-interbase have been installed from the CentOS repos. I installed an existing PHP application of mine that works fine on several other systems (Fedora, Windows...), but upon calling ibase_connect() I get:
>
> Unable to complete network request to host "localhost". Failed to establish a connection.

SOLUTION:

The problem was caused by the predefined SELinux network policy for httpd. The following booleans were both false:

httpd_can_network_connect
httpd_can_network_connect_db

Turning on the latter solved the problem:

semanage boolean -m -1 httpd_can_network_connect_db

As I understand it, this will survive a reboot (I see all kinds of stuff updated in the /etc/selinux tree).

An alternative would be

setsebool -P httpd_can_network_connect_db 1

(where the -P makes it permanent).

Thanks, everybody, for your suggestions!


Cheers,
Paul Vinkenoog