0

My shared hosting doesn't allow me to use composer install (php memory limit error). So I had to install to my clone magento2 on xampp server.

http://wiki.ebizmarts.com/installation-guide-m4m2 below are the two commands i use.

composer require mailchimp/mc-magento2 1.0.32
composer require ebizmarts/mailchimp-lib

i can see from my local copy that files are created in

vendor\mailchimp\mc-magento2\
vendor\ebizmarts\mailchimp-lib\

My question is can I just copy this two folder and upload to my live magento2 server, and run php bin/magento setup:upgrade ?

  • If it's only a memory issue I suggest trying to copy over your local composer.json and composer.lock file to the server. Running composer install (that reads the information from the lock file) generally does not require huge amounts of memory, – Kristof at Fooman Dec 14 '18 at 2:30
  • By uploading the composer.json and composer.lock files, do I still need to upload those two folders to vendor directory on the live server before running composer install? Thanks – Kris Wen Dec 14 '18 at 4:02
  • No, composer will manage the vendor directory for you and download anything that is missing. – Kristof at Fooman Dec 15 '18 at 6:49
0

You can, however you can set your own memory limit on demand.

php -d memory_limit=512M composer install

If not, do as you suggested and run the install somewhere else just rsync the /vendor folder. However I would recommend to still run the dumpautoload on the server

php -d memory_limit=512M composer dumpautoload

That will generate all the necessary autoloader files for the environment.

However, if running a composer install already gives you memory issues, I don't think bin/magento will run without problems.

So I would still do

php -d memory_limit=512M bin/magento setup:upgrade

EDIT:
You may need the location of composer to run it as a file with php. In that case you can try

php -d memory_limit=512M $(which composer) install

Which will substitute the full path of the composer command, so you can run it as a file with PHP.

  • if i do it the first way, do i need to copy over the entire /vendor folder, or just the two packages folders vendor\mailchimp\mc-magento2\ & vendor\ebizmarts\mailchimp-lib\? – Kris Wen Dec 14 '18 at 22:11
  • the whole vendor folder – DarkMukke Dec 17 '18 at 11:02

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.