13

I have autoload.php with this code

<?php

// autoload.php generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit8be239f5caef32db03f87bb271ed6012::getLoader();

but when I access to localhost

Fatal error: Class 'ComposerAutoloaderInit8be239f5caef32db03f87bb271ed6012' not found in /home/sebastian/Development/PHP/miciudad/vendor/autoload.php on line 10

Yesterday this work and I didn update.

If I run php composer.phar install will it work and generate the correct autoload.php?

Thanks!

undefined
  • 2,051
  • 3
  • 26
  • 47
benoffi7
  • 3,068
  • 3
  • 29
  • 44

1 Answers1

34

It should. Also php composer.phar dump-autoload should do the job.
As stated in the docs:

If you need to update the autoloader because of new classes in a classmap package for example, you can use dump-autoload to do that without having to go through an install or update.

undefined
  • 2,051
  • 3
  • 26
  • 47
  • 8
    Ugh, why did they name it "dump", bit counterintuitive. Should be "generate" instead. Oh well, thanks! – Ezekiel Victor Jul 20 '15 at 22:41
  • 2
    ...without prefix: `composer dump-autoload`. How to: [how-to-run-composer-from-anywhere](https://stackoverflow.com/questions/11333230/how-to-run-composer-from-anywhere) – Peter Kreinz Jan 21 '18 at 15:41