Autoload error when following the Getting Started Guide #6074

Closed
opened 2026-01-22 15:26:20 +01:00 by admin · 5 comments
Owner

Originally created by @ThomasLandauer on GitHub (Sep 25, 2018).

Originally assigned to: @Majkl578 on GitHub.

Bug Report

When following the tutorial at https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/getting-started.html (i.e. doctrine2/docs/en/tutorials/getting-started.rst), at the step vendor/bin/doctrine orm:schema-tool:create I'm getting this error:

$ vendor/bin/doctrine orm:schema-tool:update

PHP Fatal error:  Uncaught Error: Class 'Doctrine\Common\Annotations\AnnotationRegistry' not found in vendor/doctrine/orm/lib/Doctrine/ORM/Configuration.php:152
Stack trace:
#0 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Setup.php(71): Doctrine\ORM\Configuration->newDefaultAnnotationDriver(Array, true)
#1 bootstrap.php(10): Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration(Array, true)
#2 cli-config.php(3): require_once('...')
#3 vendor/doctrine/orm/bin/doctrine.php(48): require('...')
#4 doctrine/orm/bin/doctrine(4): include('...')
#5 {main}
  thrown in vendor/doctrine/orm/lib/Doctrine/ORM/Configuration.php on line 152
Originally created by @ThomasLandauer on GitHub (Sep 25, 2018). Originally assigned to: @Majkl578 on GitHub. ### Bug Report When following the tutorial at https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/getting-started.html (i.e. doctrine2/docs/en/tutorials/getting-started.rst), at the step `vendor/bin/doctrine orm:schema-tool:create` I'm getting this error: ```bash $ vendor/bin/doctrine orm:schema-tool:update PHP Fatal error: Uncaught Error: Class 'Doctrine\Common\Annotations\AnnotationRegistry' not found in vendor/doctrine/orm/lib/Doctrine/ORM/Configuration.php:152 Stack trace: #0 vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Setup.php(71): Doctrine\ORM\Configuration->newDefaultAnnotationDriver(Array, true) #1 bootstrap.php(10): Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration(Array, true) #2 cli-config.php(3): require_once('...') #3 vendor/doctrine/orm/bin/doctrine.php(48): require('...') #4 doctrine/orm/bin/doctrine(4): include('...') #5 {main} thrown in vendor/doctrine/orm/lib/Doctrine/ORM/Configuration.php on line 152 ```
admin added the Documentation label 2026-01-22 15:26:20 +01:00
admin closed this issue 2026-01-22 15:26:20 +01:00
Author
Owner

@Ocramius commented on GitHub (Sep 25, 2018):

Did you run the composer installation? What's your config file looking like?

@Ocramius commented on GitHub (Sep 25, 2018): Did you run the composer installation? What's your config file looking like?
Author
Owner

@ThomasLandauer commented on GitHub (Sep 25, 2018):

I really followed the tutorial.

Did you run the composer installation?

Sure :-)

What's your config file looking like?

Copied from https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/getting-started.html#project-setup

@ThomasLandauer commented on GitHub (Sep 25, 2018): I really followed the tutorial. > Did you run the composer installation? Sure :-) > What's your config file looking like? Copied from https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/getting-started.html#project-setup
Author
Owner

@Ocramius commented on GitHub (Sep 25, 2018):

Just tried it, and could reproduce the problem. The issue is that the composer.json in that documentation should be pointing at doctrine/orm ^2.6.2: can you maybe send a patch?

@Ocramius commented on GitHub (Sep 25, 2018): Just tried it, and could reproduce the problem. The issue is that the `composer.json` in that documentation should be pointing at `doctrine/orm` `^2.6.2`: can you maybe send a patch?
Author
Owner

@ThomasLandauer commented on GitHub (Sep 25, 2018):

Sure, see https://github.com/doctrine/doctrine2/pull/7412

@ThomasLandauer commented on GitHub (Sep 25, 2018): Sure, see https://github.com/doctrine/doctrine2/pull/7412
Author
Owner

@Majkl578 commented on GitHub (Nov 11, 2018):

#7412 has been merged.

@Majkl578 commented on GitHub (Nov 11, 2018): #7412 has been merged.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6074