2
votes

I am trying to make an Administrator Panel with securised login space. I installed Security-bundle for that.

However, I obtain this error :

There is no extension able to load the configuration for "security" (in (..)/devfuzz/config/packages/security.yaml). Looked for namespace "security", found "framework", "web_server", "maker", "doctrine_cache", "doctrine", "doctrine_migrations", "twig", "swiftmailer", "sensio_framework_extra", "knp_paginator" in /home/fuzzdesize/devfuzz/config/packages/security.yaml (which is loaded in resource "/home/fuzzdesize/devfuzz/config/packages/security.yaml").

My Composer.json :

{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.1.3",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "doctrine/annotations": "^1.6",
        "knplabs/knp-paginator-bundle": "^3.0",
        "sensio/framework-extra-bundle": "^5.2",
        "symfony/apache-pack": "^1.0",
        "symfony/asset": "4.2.*",
        "symfony/console": "4.2.*",
        "symfony/dotenv": "4.2.*",
        "symfony/flex": "^1.1",
        "symfony/form": "4.2.*",
        "symfony/framework-bundle": "4.2.*",
        "symfony/http-foundation": "4.2.*",
        "symfony/orm-pack": "^1.0",
        "symfony/security-bundle": "4.2.*",
        "symfony/swiftmailer-bundle": "^3.2",
        "symfony/translation": "4.2.*",
        "symfony/twig-bundle": "4.2.*",
        "symfony/validator": "4.2.*",
        "symfony/web-server-bundle": "4.2.*",
        "symfony/yaml": "4.2.*",
        "twig/twig": "^2.0"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "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.2.*"
        }
    },
    "require-dev": {
        "symfony/maker-bundle": "^1.11"
    }
}

My bundles.php :

<?php

return [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true],
    Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
    Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
    Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
    Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
    Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
    Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true],
    Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
    Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true],
];

I can see that Security is not in the bundles.php file. So how can I add it ? Will it solve the problem ? Or do I need to do something else ?

1
Yes you should add it inside your bundles.php file, according to my vanilla Sf4 install.thomas.drbg

1 Answers

3
votes

It seems that the install of security-bundle did not add automatically the line of the bundle security in bundles.php.

I solved this by adding manually that line :

Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true ],