Install Magento 2 with sample data: In this article, we are going to learn how to install Magento 2 with sample data via Xampp (Localhost)
After downloading the Xampp, install the Xampp first on your PC or computer. let’s check in the below section how to install Xampp on a system.
How To Install Xampp Server on Windows
Step 1. Run the setup.exe file of Xampp Server
After Download the Xampp, click on the setup.exe file of Xampp then click on the Next button.
Step 2. Make Sure all these check-boxes are checked
To make sure, check all these checkboxes are Right or False and then click on the Next button.
Step 3. Choose a folder to install the Xampp
choose and select a folder where you want to install the Xampp and then click Next button.
Step 4. Uncheck the checkbox
In this step, now you can un-check the checkbox and then Right-click on Next button.
Step 5. Xampp is Ready for Installation
Now the Xampp is ready to install on your computer just Right-click on Next Button.
Step 6. The Process Installing Xampp is Start
The process of Xampp starts to install on your computer.
Step 7. The Process Installing Xampp is Finish
In the last step, the installing process of Xampp is finished. You can use it right now.
How To Install Magento 2 with Sample Data on Xampp
Download Magento 2 (Full Release with Sample Data (ZIP with sample data)
After download the Magento 2 with sample data. Extract the file and copy and paste in xampp/htdocs folder and rename it as you want, in my case I rename it Magento2.
Step 1. Search This Number (127.0.0.1) on Google Page
Open your google page and type the number which is shown by the red arrow sign on the screen-shot and then click, Enter button.
Step 2. Welcome To Magento Admin, Run (Agree and setup Magento)
Welcome to Magento Admin, click on the Agree and setup Magento button.
Step 3. Start Readiness check
To check the PHP error, Double-click on the Start readiness check button.
Step 4. You Need To Fix These Issues To Continue
First of all, we need to fix these error which indicates by the red circle.
Now, Enter ctrl+F and type (xsl) in the search box then click on the Find Next Button.
Remove the sign which shown by the red arrow sign
After removing the ( ; ) sign, save the php.ini file and then restart the Xampp.
Step 5. Now we have no Error in the Magento 2
Now you can see that after a change in php.ini file we have no error in the Magento 2. Click, Next button.
Step 6. Create a Database on phpMyAdmin
Go to phpMyAdmin, Click on the Database then enter the database name, and then click on the create button.
Step 7. Enter the Database name in the Text-box
Fill the database name which you can create in the phpMyAdmin and click Next button
Step 8. Set Magento Admin Address here
Set the Magento Admin Address in the text box then click, Next button.
Step 9. Choose and select all these fields and sure that you have select all of the Advanced Modules Configurations.
When you can set all fields then click on Advanced Modulus configurations and check that you have select all of the Advanced Modulus configurations.
Step 10. Create a new Admin Account
To manage your store, create a new admin account. Type your username, new email, new password and confirm password
Step 11. Install Now (The process of installation starts)
Now just click on the install button to start the installation process
After complete installing 100%, our installation is completed.
Note: After the installation process is finished you can type again in google (127.0.0.1)
Step 12. The process installation of Magento is complete
Now you can see that our Magento installation is complete.
Step 13. Search (127.0.0.1/admin) on Google for signing Magento
At this step, run the Google page and type (127.0.01/admin). After the Magento Admin panel will open, type your username and password then click sign in button.
Step 14. The icon and admin links are not working properly
After login to admin panel of the Magento, you can see that our icons and admin links are not working properly like that image.
Step 15. Select the (di) file and open this file into your code editor
Go to our installation folder and then click the app file then click, etc. Here you can see the file (di) open this file into your code editor, like notepad++, sublime or Netbeans etc
Step16. In the line of (645) replace the word symlink to copy and save file
In (di) file just replace the word Symlink to Copy in the line of (645) and then save file. Now check the admin panel of the Magento you can see that our icons working fine.
Step 17. The icon and admin links are working properly
Now you can see that everything is working good
Step18. Check the front hand of the store
Finally, the logo has also come at the Magento page. we have succeeded to installed Magento 2 With Sample Data Via Xampp (Localhost).
I hope you guys have gotten something from this step by step guide. If you have any problems or questions, feel free in the comment section, as soon as we solve your problem. Thanks for having with us.
Magento 2 sample data not showing
I had the same issue. thx to the @wogale group for pointing me to
bin/magento module:status where I was not able to see the presence of the Modules ‘*SampleData’.
I was not able to see sample data after the following command:
$ ./bin/magento sampledata:deploy
Since my terminal was small I had to scroll up to read the following error:
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 88614883 bytes) in Users/…/public_html/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php on line 247
It seemed that the sample data wasn’t installed because of lack of memory.So… I had to increase the memory to be able to install the sample data.
$ php -dmemory_limit=1024M ./bin/magento sampledata:deploy
After that and
$ php bin/magento setup:upgrade I notice the sample data.
Magento 2 remove sample data
- Log in to the Magento server as, or switch to, a user who has permissions to write to the Magento file system. One way to do this is to switch to the Magento file system owner.If you use the bash shell, you can also use the following syntax to switch to the Magento file system owner and enter the command at the same time:
su <Magento file system owner> -s /bin/bash -c <command>
If the Magento file system owner does not allow logins you can do the following:
sudo -u <Magento file system owner> <command>
- To run Magento commands from any directory, add
<your Magento install dir>/binto your system
PATH.Because shells have differing syntax, consult a reference like unix.stackexchange.com.bash shell example for CentOS:
You can also run the commands in the following ways:
cd <your Magento install dir>/binand run them as
./magento <command name>
php <your Magento install dir>/bin/magento <command name>
<your Magento install dir>is a subdirectory of your web server’s docroot. Need help locating the docroot? Click here.
Remove sample data modules
Enter the following command:
Magento sample data download
If you want to download Magento sample data, so you can easily download the latest version of Magento sample data from here;
Download Magento sample data
Install Magento 2 without Composer
First, check if Composer is already installed:
In a command prompt, enter any of the following commands:
composer list --help
If command help displays, Composer is already installed.
If an error displays, use the following steps to install Composer.
To install Composer:
- Change to or create an empty directory on your Magento server.
- Enter the following commands:
curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer