To see current mode in Magento 2, run
1 |
php bin/magento deploy:mode:show |
Example To set Magento 2 in production mode, run
1 |
php bin/magento deploy:mode:set production |
See Magento 2 […]
To see current mode in Magento 2, run
1 |
php bin/magento deploy:mode:show |
Example To set Magento 2 in production mode, run
1 |
php bin/magento deploy:mode:set production |
See Magento 2 […]
To change email address of an admin user, run following SQL in MySQL command promt or in phpMyAdmin
1 |
update admin_user set email='NEW_EMAIL_ADDR_HERE' where email='OLD_EMAIL_ADDR_HERE'; |
See Magento 2 […]
Magento 2.4.0 come with Two-Factor authentication. Once you installed Magento 2.4.0 or latest you will be asked to setup Two-Factor Autentication. To Disable Two-Factor Authentication, edit file
1 |
vi app/etc/config.php |
Find
1 |
'Magento_TwoFactorAuth' => 1, |
Replace with
1 |
'Magento_TwoFactorAuth' => 0, |
Run commands
1 2 |
php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f |
Now you will be able to login to Magento Admin with out setting up Two-Factor autentication. See Magento 2 […]
To enabel SSL on magento 2 site using command line (SSH), first change to the folder where magento installed.
1 |
cd /home/yoursite/html |
Now run
1 2 |
php bin/magento setup:store-config:set --use-secure=1 --base-url="https://m2.serverok.in" php bin/magento setup:store-config:set --use-secure-admin=1 --base-url="https://m2.serverok.in" |
Replace “m2.serverok.in” with your Magento installation Url. […]
To install Magento 2
1 |
php bin/magento setup:install --base-url=https://yourdomain.com --db-host=localhost --db-name=magento --db-user=root --db-password=MYSQL_ROOT_PW_HERE --admin-firstname=Yujin --admin-lastname=Boby [email protected] --admin-user=OkAdmin --admin-password=ADMIN_PW_HERE --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --backend-frontname="admin" --search-engine=elasticsearch7 |
To create an Admin user, run
1 |
php bin/magento admin:user:create --admin-user="serverok" --admin-firstname="Server" --admin-lastname="Ok" --admin-email="[email protected]" --admin-password="[email protected]" |
Maintanance mode
1 |
php -d memory_limit=-1 bin/magento maintenance:enable |
Check Maintanance mode status
1 |
php -d memory_limit=-1 bin/magento maintenance:status |
To allow IP in maintance mode
1 |
php -d memory_limit=-1 bin/magento maintenance:allow-ips 117.247.196.198 112.133.248.2 |
Flush magento cache
1 |
php bin/magento cache:flush |
Deploy static content
1 |
php -d memory_limit=-1 bin/magento setup:static-content:deploy |
See Magento 2 […]