Deploy my Symfony App

Hey guys i’m new here and need help, to deploy my Symfony Project.

I uploaded all files that I got in my project in the new directory, except the .git and public folder, that I created for the file in the project.

In the htdocs directory I add my public stuff like the assets directory and my default index.php file:

<?php

use App\Kernel;

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (array $context) {
    return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};

I have no .htaccess file in here and also could generate one in the project itself by running php bin/console make:htaccess.

I also use a docker-compose.yml in my Project that looked like this:

version: "3"

services:

  nginx:
    image: nginx:latest
    ports:
      - "8000:80"
    volumes:
      - .:/var/www/html
      - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - php

  php:
    build:
      context: .
      dockerfile: docker/php/Dockerfile
    volumes:
      - .:/var/www/html
    working_dir: /var/www/html

  db:
    image: mysql:latest
    ports:
      - "3306:3306"
    environment:
      - MYSQL_USER=username
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=databasename
      - MYSQL_RANDOM_ROOT_PASSWORD=yes

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    environment:
      PMA_HOST: db
      PMA_PORT: 3306
    ports:
      - '8085:80'
    depends_on:
      - db

DB is also already done.

Error Message

when i try to open up my website i found the error in console: Failed to load resource: the server responded with a status of 500 ()

Also got this response if im trying to open the site:

Other Information

Could someone please help me out ?

Please read

9 Likes

Thanks, now i got this error:

Means that the connection to the DB failed, right?

Fix it thanks for help!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.