Install Magento on WSL

Install Magento on WSL

Install Magento on WSL


wsl --install

Apache2
sudo apt install apache2
sudo service apache2 restart

PHP 8.0
sudo apt update
sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
sudo apt install php8.2

Mysql
sudo apt update
sudo apt install mysql-server
sudo service mysql restart
create database test;
CREATE USER 'core'@'localhost';
GRANT ALL PRIVILEGES ON base.* To 'base'@'localhost' IDENTIFIED BY 'base';

GRANT ALL ON base.* TO 'root'@'localhost';

sudo apt install phpmyadmin

sudo update-alternatives --set php /usr/bin/php8.3

sudo apt-get install  php8.1-pdo-mysql  php8.1-gd php8.1-mcrypt php8.1-curl php8.1-intl php8.1-xsl php8.1-mbstring  php8.1-zip php8.1-soap php8.1-bcmath

sudo nano /etc/apache2/sites-available/magento2.conf

<VirtualHost *:80>
     ServerAdmin admin@domain.com
     DocumentRoot /var/www/html/magento2/
     ServerName http://local.core.com

     <Directory /var/www/html/magento2/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

sudo a2ensite magento2.conf
sudo a2enmod rewrite

Java
sudo apt install openjdk-11-jdk
or
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt install openjdk-11-jdk


php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
php -r "unlink('composer-setup.php');"

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento/



wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.9-linux-x86_64.tar.gz
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.9-linux-x86_64.tar.gz.sha512
shasum -a 512 -c elasticsearch-7.17.9-linux-x86_64.tar.gz.sha512 
tar -xzf elasticsearch-7.17.9-linux-x86_64.tar.gz
cd elasticsearch-7.17.9/
./bin/elasticsearch



php bin/magento setup:install \
--base-url=http://local.core.com \
--db-host=localhost \
--db-name=core \
--db-user=root \
--db-password=root \
--backend-frontname=admin \
--admin-firstname=admin \
--admin-lastname=admin \
--admin-email=admin@admin.com \
--admin-user=admin \
--admin-password=admin@123 \
--language=en_US \
--currency=USD \
--timezone=America/Chicago \
--use-rewrites=1 \
--search-engine=elasticsearch7 \
--elasticsearch-host=localhost \
--elasticsearch-port=9200

php bin/magento s:up
php bin/magento s:d:c
php bin/magento s:s:d -f

0 Response to "Install Magento on WSL"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel