DoctrineBundle doesn’t install on VM in Symfony 4.4

I work on a symfony 4.4 project and I needed to move my workspace to a virtual machine.

Problem

In my VM workspace

git clone https://gitlab.domaim.com/repo/myrepo.git
cd myrepo
php composer.phar install

Every bundle is installed correctly but at the end of the script when it try to clean cache it throws an error :

Attempted to load class “DoctrineBundle” from namespace “DoctrineBundleDoctrineBundle”.
Did you forget a “use” statement for another namespace?

Weird because on the composer output it shows doctrine/doctrine-bundle but in vendors/doctrine, the doctrine-bundle folder is empty…

What I tried

In my Local workspace

I wanted to try the same commands in my local environnement and here every thing works fine…

In both environments, I have the same php version PHP-7.2.30 and the APP_ENV is set to dev in both too.

I really don’t understand what’s happening. Thanks for help

EDIT: My composer.json

{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.1.3",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "anyx/login-gate-bundle": "^0.7.1",
        "damienharper/doctrine-audit-bundle": "^3.2",
        "doctrine/doctrine-bundle": "^2.0",
        "doctrine/doctrine-migrations-bundle": "^2.1",
        "doctrine/orm": "^2.7",
        "easycorp/easyadmin-bundle": "2.3.5",
        "friendsofsymfony/user-bundle": "~2.0",
        "onurb/excel-bundle": "^1.0",
        "phpoffice/phpspreadsheet": "^1.10",
        "shivas/versioning-bundle": "^3.2",
        "symfony/asset": "4.4.*",
        "symfony/console": "4.4.*",
        "symfony/dotenv": "4.4.*",
        "symfony/flex": "^1.3.1",
        "symfony/framework-bundle": "4.4.*",
        "symfony/ldap": "4.4.*",
        "symfony/monolog-bundle": "^3.5",
        "symfony/translation": "4.4.*",
        "symfony/webpack-encore-bundle": "^1.7",
        "symfony/yaml": "4.4.*",
        "twig/extensions": "^1.5",
        "twig/twig": "^2.0",
        "white-october/pagerfanta-bundle": "^1.3"
    },
    "require-dev": {
        "doctrine/doctrine-fixtures-bundle": "^3.3",
        "symfony/maker-bundle": "^1.14",
        "symfony/profiler-pack": "^1.0",
        "symfony/web-server-bundle": "4.4.*"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App": "src/",
            "SiiDeliveryBundle": "libraries/delivery"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "SiiDeliveryBundle": "libraries/delivery"
        }
    },
    "replace": {
        "paragonie/random_compat": "2.*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "4.4.*"
        }
    }
}

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *