1

I've got an application placed in path

/var/www/webapp/myapp

"vendor" folder is placed in

/var/www/webapp/myapp/OLDdir/vendor

Now i want to change this in

/var/www/webapp/myapp/NEWdir/vendor

Done. I have updated the path to autoload, of course.

/var/www/webapp/myapp/NEWdir/vendor/autoload.php

Composer's autoload fails because

require_once(/var/www/webapp/myapp/OLDdir/vendor/composer/autoload_real.php):
failed to open stream: No such file or directory in
/var/www/webapp/myapp/OLDdir/vendor/autoload.php

I tried every command line, such as dump-autoload and clear-cache but nothing changes! It is always looking for OLDdir, somehow. I ran a full-text search for "OLDdir" in the entire folder tree, but nothing was found.

I guess if it is possible to change some folder name having composer installed... is it?

Thank you

Marco
  • 759
  • 3
  • 9
  • 22
  • Have a look [here](http://stackoverflow.com/questions/22700728/composer-loading-from-cache). – Andrei Sep 30 '16 at 10:12

1 Answers1

0

You may change vendor directory name and location from composer.json

{
    "config": {
        "vendor-dir": "new_vendor_path"
    }
}
Marius Bogdan
  • 424
  • 4
  • 10
  • I'm sorry but nothing changes. 1) I tried the "vendor-dir" solution, than i ran dump-autoload and clear-cache again but the error message is the same, and with the same OLDdir path. 2) I had a look at the link: ok, i found the "cache" folder under ~/.composer, so what am I supposed to do now to solve my problem? – Marco Oct 04 '16 at 09:49
  • 1
    Try removing the vendor directory, new and old. Then run `composer update` instead of install. Composer install will create the structure that is registered in composer.lock file. You'll need to overwrite the lock file by running `composer update` – Marius Bogdan Oct 04 '16 at 13:42