How to run PHP + Firebird in Docker?

0

I'm trying to run / create a container in docker with PHP + Firebird, I found a container that runs Firebird , I found another one that runs PHP and Firebird, but when I try to consume the database:

$conn  = ibase_connect('localhost:/database.fdb', 'user', 'masterkey');

I get the message:

Warning: ibase_connect(): Unable to complete network request to host "localhost". Failed to establish a connection

I am working on a project that currently runs Firebird and we need to migrate to PHP / MySQL and as it is a very large bank we need to constantly access to migrate the data. I've done some testing on Windows using IBExpert, the bank is working properly.

Has anyone ever had this problem, or have you tried using PHP + Firebird in Docker?

RESOLVED

The links property was missing so the other container could connect to the bank. I'll leave docker-compose.yml here if someone needs to connect to Firebird + PHP using Docker.

version: '2'
services:
  db:
    image: jacobalberty/firebird:2.5-ss
    ports:
      - 3050:3050
    volumes:
      - ./data:/databases
  php:
    image: almeida/php-firebird
    ports:
      - 80:80
    volumes:
      - ./www:/usr/share/nginx/html/
    links:
      - db

The password to access firebird inside the db container is inside the file /firebird/etc/SYSDBA.password

    
asked by anonymous 20.12.2017 / 02:13

1 answer

1

I still do not have access to the comments, so I'll respond directly here.

I do not know how you created the container, whether you joined firebird and php in the same container (which is not recommended) or if you put the two in separate containers.

If you created the two separately you need to link the two containers so that there is communication, only with localhost not working, that article explains this. You also have this docker world article .

    
27.12.2017 / 13:53