0
php bin/console clear-cache:

PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "Use rBundle" from namespace "UserBundle\UserBundle". Did you forget a "use" statement for another namespace? in /var/www/html/projects/Event-Finance/api/app/AppKernel.php:21 Stack trace:#0 /var/www/html/projects/Event-Finance/api/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(48 8): AppKernel->registerBundles()#1 /var/www/html/projects/Event-Finance/api/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(13 2): Symfony\Component\HttpKernel\Kernel->initializeBundles() #2 /var/www/html/projects/Event-Finance/api/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/App lication.php(64): Symfony\Component\HttpKernel\Kernel->boot() #3 /var/www/html/projects/Event-Finance/api/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php( 148): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Componen in /var/www/html/projects/Event-Finance/api/app/AppKernel.php on line 21

1

2 Answers 2

1

I have passed 2 days to fix this error by uploading, configuring symfony several time. Changing the directory permissions and so many thing. Finally I have fix this issues in my Symfony 3.4 project.

There are 2 things you need to do to fix this error:

  1. In the composer.json, modify the psr-4 section under autoload section like this.
"autoload": {
    "psr-4": {
        "": "src/"
    },
},
  1. Then execute the following command

composer dumpautoload

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. This helped me fix my issue.
0

There is a typo in your bundle name:

Use rBundle should be UserBundle.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.