404 on DebugBar when use Docker

Hi Everyone. I face problem with debugbar when I use Docker. I created a new fresh project to try passby this error but didn’t work. It’s impossible run it when I use docker.

The strange thing is the Gii works very well!

Following my configs.

web/index.php


defined('YII_DEBUG') or define('YII_DEBUG', true);

defined('YII_ENV') or define('YII_ENV', 'dev');

config/web.php


if (YII_ENV_DEV) {

    // configuration adjustments for 'dev' environment

    $config['bootstrap'][] = 'debug';

    $config['modules']['debug'] = [

        'class' => 'yii\debug\Module',

        'allowedIPs' => ['*'],

    ];


    $config['bootstrap'][] = 'gii';

    $config['modules']['gii'] = [

        'class' => 'yii\gii\Module',

        'allowedIPs' => ['*'],

    ];

}

docker-compose.yml


version: '3.1'


services:

    lt-timesheet-server:

        image: yiisoftware/yii2-php:7.1-apache

        container_name: lt-timesheet-server

        volumes:

            - ~/.composer-docker/cache:/root/.composer/cache:delegated

            - ./:/app:delegated

        working_dir: /var/www/html

        ports:

            - '8080:80'

        networks:

            - lt-timesheet-network

        environment:

            PHP_XDEBUG_ENABLED: 1 # Set 1 to enable.

            XDEBUG_CONFIG: "remote_host=172.17.0.1 remote_enable=1"

            

    lt-timesheet-mysql:

        image: mysql:5.7

        container_name: lt-timesheet-mysql

        # restart: always

        environment:

            - MYSQL_ROOT_PASSWORD=secret

            - MYSQL_USER=secret

            - MYSQL_PASSWORD=secret

        ports:

            - "3306:3306"

        networks:

            - lt-timesheet-network

        volumes:

            - ./volumes/database/data:/var/lib/mysql


    lt-timesheet-phpmyadmin:

        image: phpmyadmin/phpmyadmin:4.7

        container_name: lt-timesheet-phpmyadmin

        ports:

            - '8081:80'

            - '443:443'

        networks:

            - lt-timesheet-network

        environment:

            - PMA_ARBITRARY=1

            - PMA_HOST={DB_HOST}

        depends_on:

            - lt-timesheet-mysql

        volumes:

            - ./volumes/database/data:/var/lib/mysql


networks:

    lt-timesheet-network:

        driver: bridge



I don’t know what I need to do anymore. Someone can help me?

No one face the problem? Til now I can’t sove it

Instead of using debugbar, try to use Xdebug to debug this PHP script. You can integrate Xdebug with any IDE, like PHPStorm or VSCode. If not Xdebug, you can use any other PHP debugging tool to debug this problem in Yii.