arsenalftw067
arsenalftw067

Reputation: 261

Copying Vendor Folder vs. Composer

I used composer on my local server for development, and now we want to shift the end product to a web server to make the website live.

Does simply using ftp/copying&pasting the vendor folder work? Or will I have to use composer for installation?

The vendor folder I want to move isn't large by any means.

Upvotes: 4

Views: 4468

Answers (1)

Erik Baars
Erik Baars

Reputation: 2298

You can safely copy the vendor folder along with your project, as long as you copy the composer.json and composer.lock files as well.

I've worked with deployment scripts in the past, and what I usually do is run composer install on a staging server, run all pre-deployment tests, and if everything is fine, copy the files to the production server.

Note however, that you should always make sure that the server you are copying from has the same installtion as the one you are copying to. If for instance the PHP version is different, or some php extension is not present on the production server, the package will be there, but wont run the same as it did on the other server, or might not run at all

Upvotes: 4

Related Questions