Cannot install Sample Data

Hi Craig, Thanks for your quick response… Ok I got round it, I was under the impression I would be using the new created user for the logins but then realised it was still root. Anyways I got it all up and running back and frontend but now stumbling across this error when trying to install the demo data

Do you want to store credentials for in /var/www/html/var/composer_home/auth.json ? [Yn] Y
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 20 installs, 0 updates, 0 removals

  • Installing magento/module-catalog-sample-data (100.3.0): Downloading (100%)
    proc_open(): fork failed - Cannot allocate memory
    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class
    The following exception is caused by a lack of memory or swap, or not having swap configured
    Check for details

In Process.php line 304:

proc_open(): fork failed - Cannot allocate memory

require [–dev] [–prefer-source] [–prefer-dist] [–no-progress] [–no-suggest] [–no-update] [–no-scripts] [–update-no-dev] [–update-with-dependencies] [–update-with-all-dependencies] [–ignore-platform-reqs] [–prefer-stable] [–prefer-lowest] [–sort-packages] [-o|–optimize-autoloader] [-a|–classmap-authoritative] [–apcu-autoloader] [–] […]

There is an error during sample data deployment. Composer file will be reverted.

Moved reply to a new post in order to keep the previous topic relevant.

1 Like

I’ve seen this before. It was related to the available system memory of the server. Composer+Magento struggle to run with anything less than 2GB.

  • Check that your server meets the minimum requirements
  • Check that you’ve allocated at least 2GB of memory in .htaccess (covered in the guide under Update memory_limit)
  • Verify that the above is set correctly by following 2. Listing critical PHP information on this post. This will show you the true value of memory_limit for the local directory

1 Like

Ok, I can confirm that htaccess is setup to 2G on both, Not sure how I get to the the little snippet screenshot your showing?.. also, following your guide basically leaves all amendments including the download of magento to finishing up activating developer mode and installing demo content in the magento user and not admin, is this correct?

My last reply has a link to a post, where it explains how to view your php information (like screenshot) under the 2. Listing critical PHP information heading.

Yes, there is no need to be root user unless you’re changing system files or restarting service such as apache, mysql or the server itself. Any actions you carry out on Magento whilst in the /var/www/html/ folder will usually be done as magento.

Ok, not sure whether it was a max 4gb on the vps i had, but i have just setup a hetzner vps with dual vcpu with 8gb ram, only cost 10eu so bargain :D… Just at the final stages of setting up developer and taking snapshot, so will keep you updated.

Hey Craig, All seems to have gone in and done successfully this time, no errors as far as i can see. Only thing now is the back/frontend is real slow at loading up… was instant before the demo content install… htop showing cpu maxed out with /usr/sbin/apache2 -k start. any ideas?

1 Like


High CPU load happens sometimes when caching everything for the first time. Make sure all of your caches are enabled as this will significantly reduce the load once everything it cached. You can do that in the backend or via CLI using either of these 2 commands (they do the same thing):

  • bin/magento c:e
  • bin/magento cache:enable.

Is that under the magento user in the www folder? I cant even get into the back end its taking that long,

Yes, any bin/magento commands should be run as magento user within /var/www/html.

Technically speaking, you can run the command from anywhere but I keep all my instructions within the same folder because it’s good practice and results in simpler commands.

Oh yes, that nailed it my good friend, Thankyou for an awesome tutorial and your continued support today, Hope you dont mind if I get in touch if I get stuck !!

Many Thanks

No problem. You were lucky. I never normally have the time to be this active in such as short period. Feel free to post any new topics to:

  • Share your experiences
  • Discuss ideas
  • Ask for help

Or simply help others who may run into issues that you’ve already figured out :+1: