0

I’ve been reading up a lot and it’s confusing as everyone seems to recommend using Composer to install and maintain Magento 2 but I can’t find answers to some basic questions:

  1. I have a server with lots of cPanel accounts. I believe Composer is something that is installed per server - not per cPanel account?

  2. Can Composer only look after one Magento 2 system? I want to have a Development system on a subdomain, another rough test system (with demo data to play around with) in a subfolder on a different domain and eventually have a Live system on yet another domain, the Live domain. These will all be on the same server under different cPanel accounts. The live system will be a copy of the dev system so I will need to clone dev system at some point. Could all these be updated by Composer at different times?

  3. If I don’t use Composer and use Setup Wizard is it easy to apply Magento updates, patches, extensions and extension upgrades.

  4. Would I have any problems in the future if I didn’t use Composer? Is it still easy to do updates even if not as easy as with composer?

  5. What is best way to install and manage the 3 Magento systems I outlined?

Thanks

2

I have a server with lots of cPanel accounts. I believe Composer is something that is installed per server - not per cPanel account?

Per server yes. However also per php version. On cpanel I recommend you utlise aliases.

alias php71='/opt/cpanel/ea-php71/root/usr/bin/php'

alias php72='/opt/cpanel/ea-php72/root/usr/bin/php'

alias composer='/opt/cpanel/ea-php72/root/usr/bin/php /opt/cpanel/composer/bin/composer'

alias composer71='/opt/cpanel/ea-php71/root/usr/bin/php /opt/cpanel/composer/bin/composer'

So running composer71 install vendor/extension etc will use php71. This matters for dependencies.

Can Composer only look after one Magento 2 system? I want to have a Development system on a subdomain, another rough test system (with demo data to play around with) in a subfolder on a different domain and eventually have a Live system on yet another domain, the Live domain. These will all be on the same server under different cPanel accounts. The live system will be a copy of the dev system so I will need to clone dev system at some point. Could all these be updated by Composer at different times?

Per magento install. Providing you are working with a different composer.json and composer.lock files these are independent projects.

If I don’t use Composer and use Setup Wizard is it easy to apply Magento updates, patches, extensions and extension upgrades.

I'm on the fence about this. So far I've not been able to apply patches using composer.

EmailMessageInterface backward compatibility issue patch for Magento 2.3.3

Although I could misunderstand. Extensions and upgrades fine though. Although you can install extensions without using composer. In which case you will have to manually update.

Would I have any problems in the future if I didn’t use Composer? Is it still easy to do updates even if not as easy as with composer?

Yes and no. Extension updates no problem. Core updates - yes problem.

What is best way to install and manage the 3 Magento systems I outlined?

Separate cPanel accounts. Or subdomains. Whatever works for you. Providing you have separate web roots. Then use composer in the different web roots based on your requirements. cPanel will let you manage different versions of php in the different web roots too.

| improve this answer | |
  • Thanks for the reply. I just needed to know that I could use Composer independently on each of the systems and from what you say I can so I'll go ahead and attempt to install my rough test system and development test system using Composer. One further question - when my development test system is ready for live I would normally copy this to my live domain by copying database, files etc. Will I be able to copy the system to live domain using Composer? – traknet Nov 9 '19 at 9:30
  • Nope dont use composer to migrate. Copy files from development to live - web root to web root. If you include vendor folder plus composer.json and composer.lock sites will be in exact same state in terms of composer. – Dominic Xigen Nov 9 '19 at 20:03
  • Thanks for your help, I'll get on with attempting to install my system using Composer! – traknet Nov 11 '19 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.