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

Errors on composer install, missing dependencies in composer.json #2

Open
akserikawa opened this issue Feb 1, 2019 · 2 comments
Open

Comments

@akserikawa
Copy link

akserikawa commented Feb 1, 2019

!!  PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "DoctrineBundle" from namespace "Doctrine\Bundle\DoctrineBundle".
...
!!  PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "DoctrineCacheBundle" from namespace "Doctrine\Bundle\DoctrineCacheBundle".

Solved by adding the following packages to composer.json

composer require doctrine/orm
composer require doctrine/doctrine-cache-bundle
composer require doctrine/doctrine-bundle
composer require doctrine/doctrine-migrations-bundle

Also, composer install throws another error due to symfony/flex version being outdated

@akserikawa
Copy link
Author

akserikawa commented Feb 1, 2019

When running php bin/console doctrine:migrations:migrate it says:

PHP Fatal error:  Class 'Doctrine\DBAL\Migrations\AbstractMigration' not found in /Users/myuser/Sites/adr-blog/src/Migrations/Version20180526152815.php on line 11

Solved by changing:

# in src/Migrations/Version20180526152815.php

- use Doctrine\DBAL\Migrations\AbstractMigration;
+ use Doctrine\Migrations\AbstractMigration;

btw, my composer.json:

{
    "require": {
        "php": "^7.1.3",
        "ext-iconv": "*",
        "doctrine/doctrine-bundle": "^1.10",
        "doctrine/doctrine-cache-bundle": "^1.3",
        "doctrine/doctrine-migrations-bundle": "^2.0",
        "doctrine/orm": "^2.6",
        "symfony/console": "^4.0",
        "symfony/flex": "^1.0",
        "symfony/framework-bundle": "^4.0",
        "symfony/lts": "^4@dev",
        "symfony/phpunit-bridge": "^4.0",
        "symfony/yaml": "^4.0"
    },
    "require-dev": {
        "symfony/dotenv": "^4.0",
        "symfony/web-server-bundle": "^4.0"
    },
    // ...
}

@akserikawa
Copy link
Author

akserikawa commented Feb 1, 2019

Managed to run the project after a bit of hussle.

I had to install the following:

composer require symfony/serializer
composer require symfony/property-access

It all works fine for now!

@akserikawa akserikawa changed the title Errors on composer install, doctrine dependencies missing from composer.json Errors on composer install, missing dependencies in composer.json Feb 1, 2019
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

1 participant