Installing Sample Data breaks Magento by making it too slow

Hi,

I just finished Craig’s tutorial of fresh installation of Magento 2.3 from scratch. Before, I created Ubuntu server on VirtualBox.

Everything was working smooth and fine till the very last step. After installing sample files i can not login to the admin panel nor phpmyadmin panel. Both, including the front page keeps loading endlessly

Cheers for any suggestions!

Hello, I get the same problem.
Everything was working well until the remove of html index with a magento acount which was denied for lack of permission. I had to use the sudo accont to force the removal.
At the installation of magento the package phpunit/phpunit-mock-objects was abandonned.
Now i get not panel to create user in phpmyadmin. don’t know if all that is linked.
Thank you for your help

Hi @Gracjan and welcome.

Please, can you clarify a couple of things for me:

  1. When you say “the very last step”, are you referring to the section in the documentation labelled “Download Sample Data via Composer”?
  2. To be clear, are you saying that you get this issue on both a Server and VirtualBox Setups?
  3. Can you elaborate on “loading endlessly”?

Guess 1
I haven’t got a great deal to go on right now… But have a quick look at your Cache. Sometimes this will be disabled after running a selection of commands.

However, having all of the Cache disabled can overwhelm the Web Server if it’s not configured correctly or simply doesn’t have the minimum specifications.

If you’re in the CLI, simply run the following command as the magento user inside the Magento root directory:

bin/magento cache:enable

You should see an output that displays all of your caches being enabled.

Alternatively, you can do this within System > Cache Management.

Guess 2
Similar to the first point, double check your PHP memory_limit. Even if you have a Web Server with great specs, you can get some loading issues due to PHP bottlenecking. Simply refer to the documentation labelled “Update memory_limit”.

Guess 3 (Solution)
Sometimes I’ve noticed that bin/magento setup:upgrade will disable the Cache whilst it runs but not re-enable it afterwards. Try to re-enable the cache using the following command:

bin/magento cache:enable

Hi @imad and welcome.

I believe what you’re referring to is unrelated to the OP. Would you like me to move this to its own dedicated post?

Hi and cheers for answer.
Problem exist on VirtualBox. I deleted virtualbox server yesterday and started again. The problem appeared straight after switching to the developer mode. Before that was ok. To be honest i am not sure i need developer mode. I am graphic designer and all i know my company ordered the website on magento 2.3 so i was trying to create virtual server and website on it just to play with the templates and graphics. Do I need to switch to the dev. mode at all?

Thanks

I guess it depends on the type of work you’re doing. If you’re building/modifying a theme then you’ll find it counter-productive to make any changes when not in Developer Mode. Magento 2 is incredibly modular and you’ll struggle to see many of your design changes without the constant need to redeploy static content or clear the cache. It’s also useful for displaying error messages instead of a blank screen on the off chance that you break your theme.

As you’ve now correlated the problem persisting after switching to Developer Mode, I’m not more confident of my original guess (1).

Therefore, my tip would be:

  1. Switch to Developer Mode
  2. Redenable all Basic Caches (System > Cache Management)
  3. But leave Disabled: Layouts, Blocks HTML output and Page Cache

You’ll get the benefits you need without the huge performance impact.

apparently developer mode is not a problem. ive skip that step and went straight to downloading sample data. After downloading data the problem appeared again. The website keeps loading endlessly again.

It’ll be awhile before I have the time to try and reproduce the issue. Out of curiosity, does the cache (System > Cache Management) get disabled when you install Sample Data? I can’t remember. If so, does reactivating them make a difference?

i have no clue, i was doing step by step from your tutorial so if that was on the list then yes :slight_smile:

I didn’t make a note of that. I’ll get back to you next week once I’ve set it up another VirtualBox

i am trying to solve this by some other codes from magneto forum
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush
I am literary walking blind

Download Sample Data via Composer

Magento has a really useful command for installing all of the sample data from the Magento Repository via Composer. This step can normally take a couple of minutes to complete. At times, it may appear that nothing is happening, but just give it time.

Download the same data [01:01:10]

Copy to clipboard

bin/magento sampledata:deploy

It’s been a couple of minutes and now Putty is awaiting our next command. All we need to tell Magento to do now is install the latest changes we’ve just made [01:01:56]

Copy to clipboard

bin/magento setup:upgrade

Now, when we refresh the Frontend and Backend, you can see what Magento now looks like with Sample Data.

After this section in the How to install Magento 2.3 and build a web server tutorial, my only recommendation would be to run:

bin/magento cache:enable

yeah i finished on
bin/magento setup:upgrade
And the problem appeared. I’ll try your recommendation. Cheers Craig. Ill let you know if the problem still exist.

It’s just a guess at this stage. Sometimes I’ve noticed that bin/magento setup:upgrade will disable the Cache but not re-enable it afterwards. If it works, I’ll update the main post. Good luck.

Hello ds. ok im ok to move it to the dedicates post.
tx

after i run commands which i mention above ive run bin/magento cache:enable and apparently that was helpful because now my website is running again :slight_smile: THANKS!

1 Like

Thanks for getting back to me. I’ve updated my original response and flagged it as the Solution. I have also updated the original post with the recommendation.