How to run PHP + Firebird on Docker?

Asked

Viewed 1,224 times

0

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

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

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 database we need to access constantly to migrate the data. I’ve done some tests on Windows using Ibexpert, the database is working properly.

Someone has already experienced this problem, or tried using PHP + Firebird on Docker?

RESOLVED

Was missing the property links so that the other container could connect to the bank. I’ll leave the 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

1 answer

1


I still don’t have access to the comments, so I’ll reply directly here.

I don’t know how you created the container, joined Firebird and php in the same container (which is not recommended) or put the two in separate containers.

If you created the two separately it is necessary to link the two containers for communication, only with the localhost does not work, this article explains that. There’s also this article of the world Docker.

  • Thank you @Tanya for the answer. I tried it both separately and in the same container. I will read the articles you gave me and as soon as possible, I comment here the result.

  • I added the property links to Docker-Compose.yml and then it worked, one container was not "seeing" the other. I’ll leave the Docker-Compose.yml I used here in case anyone goes through it with Firebird.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.