Composer required on the Server in case

Composer required on the Server in case wanted to use, or can use composer in my dev PC in localhost after upload generated files to My VPS server centos 6.5??

the composer executable must exist on the server to be used. how you get it there doesn’t matter.

can not execute on server but on PC/localhost… after the files generated by composer uploaded with ftp to server???

composer is only required if you want to use it on the server. if you provide the dependencies, e.g. vendor-directory, with your project files, you don’t need it.

So you can use it either on server or on client (localhost by uploading and dependencies).
A developer more comfortable work localhost can use the latter. …

Correct?

Ideally you would NOT upload the vendor directory to the server. Instead run the composer commands on the server. Also if using version control which you should you would ignore the vendor directory.

Yes, you can upload all dependencies in the /vendor directory to the server and composer is not necessary on the server to run your application or web site. It can make things a bit easier if you have it on the server but it is not a requirement.

Not to hi-jack, but I’m curious.

Say I put something together on localhost in May that has dependencies A, B, C
I upload the vendor folder, all is well

Now in July, dependency B releases a critical security update.

I would need to redo on localhost and re-upload the vendor file

But if Composer were on the server, the critical security update would happen as soon as it was released, or just be easier to do?

I don’t think this will happen by default but I imagine you can set up a cron job to run composer update periodically. However, I don’t know if I would do it - there’s always a risk of an update breaking things.

1 Like

Updating composer packages certainly has the potential to break a website. Never update composer packages on a live website before testing those changes locally or on a dev environment first. Preferably an environment that is exactly the sme as the production one. That goes for all testing.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.