Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run with docker #93

Open
AbrilJara opened this issue May 27, 2024 · 2 comments
Open

Can't run with docker #93

AbrilJara opened this issue May 27, 2024 · 2 comments

Comments

@AbrilJara
Copy link

Hi, im trying to run the app using a apache and mysql but it thows a 500 error and can't find in the logs where is the error.

This is my docker compose file:

version: '3'
services:
  mysql:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: tematres
      MYSQL_USER: tematres
      MYSQL_PASSWORD: tematres
    volumes:
      - mysql-data:/var/lib/mysql
    ports:
      - "3306:3306"

  apache:
    image: php:7.4-apache
    depends_on:
      - mysql
    ports:
      - "80:80"
    volumes:
      - ./tematres:/var/www/html/

volumes:
  mysql-data:

And this is my db config in the vocab folder:

...
$DBCFG["DBdriver"] = "";

/** Dirección IP o nombre del servidor - IP Address of the database server */
$DBCFG["Server"]      = "tematres-db-1";


/** Nombre de la base de datos Database name */
$DBCFG["DBName"]     = "tematres";

/** Nombre de usuario - login */
$DBCFG["DBLogin"]    = "tematres";

/** Passwords */
$DBCFG["DBPass"] = "temates";
...

When i go to localhost it redirects me to localhost/vocab/index.php but it throws a 500 error.

image

The logs from docker apache container:

172.22.0.1 - - [27/May/2024:16:00:55 +0000] "GET /vocab/index.php HTTP/1.1" 500 211 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"

@a-roussos
Copy link
Contributor

Hi @AbrilJara! 👋
I think the HTTP ERROR 500 message is because you're using the wrong DB password.
Your Dockerfile claims MYSQL_PASSWORD: tematres but in your vocab/db.tematres.php you have $DBCFG["DBPass"] = "temates";.

@AbrilJara
Copy link
Author

Yes, thank you. I got really stuck because I couldn't find the logs of the error until I found how to log them. Also i had to insatall some modules that aren't aviable in the php:7.4-apache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants