Category Archives: Magento 2

Magento 2

Magento2: update product attributes using sql

cat update_product_attributes_using_sql.sql
update catalog_product_entity_int -- select * from catalog_product_entity_int
set catalog_product_entity_int.value = 1
where (catalog_product_entity_int.attribute_id = 97) and catalog_product_entity_int.entity_id = (
select entity_id from (
SELECT product.entity_id as entity_id FROM bitnami_magento.catalog_product_entity product
inner join catalog_product_entity_decimal price on price.entity_id = product.entity_id and (price.attribute_id in (78))
inner join catalog_product_entity_int status_t on (status_t.entity_id = product.entity_id) and (status_t.attribute_id=97)
where (price.value >= 20 and price.value <= 21)
and (status_t.value = 1)

Magento 2: Update data for a custom product attribute

use bitnami_magento;

SELECT * FROM bitnami_magento.catalog_product_entity_varchar
where ( attribute_id = 73 ) -- and (value = '')
limit 10

replace into bitnami_magento.catalog_product_entity_varchar (attribute_id, store_id, entity_id, value )
SELECT 181, 0, product.entity_id, left(concat("https://www.amazon.com/s?k=", product.value),255)
FROM bitnami_magento.catalog_product_entity_varchar product
inner join catalog_product_entity_int status_t on ( status_t.entity_id = product.entity_id ) and ( status_t.attribute_id = 97 and status_t.value = 1 )
where (product.attribute_id=73) -- and (value = '') -- 73 = product name

SELECT * FROM bitnami_magento.catalog_product_entity_varchar
where ( attribute_id = 181 ) -- and (value = '')
order by value_id desc
limit 10

-- Update Uk Urls -----

use bitnami_magento;

SELECT * FROM bitnami_magento.catalog_product_entity_varchar
where ( attribute_id = 73 ) -- and (value = '')
limit 10

replace into bitnami_magento.catalog_product_entity_varchar (attribute_id, store_id, entity_id, value )
SELECT 180, 0, product.entity_id, left(concat("https://www.amazon.co.uk/s?k=", product.value), 255)
FROM bitnami_magento.catalog_product_entity_varchar product
inner join catalog_product_entity_int status_t on ( status_t.entity_id = product.entity_id ) and ( status_t.attribute_id = 97 and status_t.value = 1 )
where (product.attribute_id=73) -- and (value = '') -- 73 = product name

SELECT * FROM bitnami_magento.catalog_product_entity_varchar
where ( attribute_id = 180 ) -- and (value = '')
order by value_id desc
limit 10

-- *

select max(value_id) from bitnami_magento.catalog_product_entity_varchar

Magento 2: Misc. Image related SQLs

select * from bitnami_magento.catalog_product_entity_media_gallery_value_to_entity
where value_id in (232574, 242521)

-- 232574, 242521

select * from bitnami_magento.catalog_product_entity_media_gallery_value_to_entity
where value_id in (232574, 242521)

-- where value like '%ud6vtf2a_5ezdxueqvnr%'

--select * from bitnami_magento.catalog_product_entity_media_gallery_value_to_entity

select * from bitnami_magento.catalog_product_entity_media_gallery
-- where value_id in (237733, 237734)
where value like '%ud6vtf2a_5ezdxueqvnr%'

update bitnami_magento.catalog_product_entity_media_gallery
set value = '/u/d/ud6vtf2a_5ezdxueqvnr1dyny_1.jpeg'
where value = '/u/d/ud6vtf2a_5ezdxueqvnr1dyny.jpeg' and value_id=242521

select * from bitnami_magento.catalog_product_entity_media_gallery_value
-- where value_id in (232574, 242521)
where entity_id in (70414)

select * from bitnami_magento.catalog_product_entity_media_gallery_value
where label is not null

70414 shopforsoul-PTO_06RSLOC0
237733, 237734

insert into bitnami_magento.catalog_product_entity_media_gallery_value values(237733, 0, 70414, '', 3, 0, 37613)

select max(record_id) from catalog_product_entity_media_gallery_value

insert into catalog_product_entity_media_gallery_value_to_entity values (237733, 70414)

select distinct(attribute_id) from bitnami_magento.catalog_product_entity_media_gallery

Magento 2: Deactivate Products without images

update catalog_product_entity_int
-- select * from catalog_product_entity_int
set catalog_product_entity_int.value = 2
where (catalog_product_entity_int.attribute_id = 97) and catalog_product_entity_int.entity_id in (
select entity_id from (
Select distinct(product.entity_id)
FROM bitnami_magento.catalog_product_entity product
left join catalog_product_entity_media_gallery_value_to_entity valentity on valentity.entity_id = product.entity_id
left join catalog_product_entity_media_gallery image on image.value_id = valentity.value_id and (image.attribute_id in (90))
inner join catalog_product_entity_int status_t on (status_t.entity_id = product.entity_id) and (status_t.attribute_id=97 and status_t.value=1)
where product.entity_id not in (select entity_id from catalog_product_entity_media_gallery_value_to_entity)
) as c )

Administering Magento 2 on AWS Platform

Varnish:
Configuring Varnish Server i.e. a Cache Server
https://varnish-cache.org/docs/5.1/reference/varnishd.html#http-resp-hdr-len

/opt/bitnami/varnish/varnishd

varnishd [-a address[:port][,PROTO]] [-b host[:port]] [-C] [-d] [-F] [-f config] [-h type[,options]] [-I clifile] [-i identity] [-j jail[,jailoptions]] [-l vsl[,vsm]] [-M address:port] [-n name] [-P file] [-p param=value] [-r param[,param...]] [-S secret-file] [-s [name=]kind[,options]] [-T address[:port]] [-t TTL] [-V] [-W waiter] [-x parameter|vsl|cli|builtin] [-?]

---

How to fix 503: Backend Fetch error
Give it a try; no guarantee. Purge Varnish cache as well. magento cache clearing also causes varnish cache Purge
https://community.magento.com/t5/Magento-2-x-Programming/how-to-fix-Error-503-Backend-fetch-failed/td-p/84061

----

Configure And Use Varnish (TM)

See if your version and platform is right before applying
https://docs.bitnami.com/bch/apps/wordpress/administration/configure-use-varnish/


Deploy content

setup:static-content:deploy [-f|--force] [-s|--strategy [STRATEGY]] [-a|--area [AREA]] [--exclude-area [EXCLUDE-A
REA]] [-t|--theme [THEME]] [--exclude-theme [EXCLUDE-THEME]] [-l|--language [LANGUAGE]] [--exclude-language [EXCL
UDE-LANGUAGE]] [-j|--jobs [JOBS]] [--max-execution-time [MAX-EXECUTION-TIME]] [--symlink-locale] [--content-versi
on CONTENT-VERSION] [--refresh-content-version-only] [--no-javascript] [--no-css] [--no-less] [--no-images] [--no
-fonts] [--no-html] [--no-misc] [--no-html-minify] [--] [<languages>...]

By

Sayed Ahmed

BSc. Eng. in Comp. Sc. & Eng. (BUET)
MSc. in Comp. Sc. (U of Manitoba, Canada)
MSc. in Data Science and Analytics (Ryerson University, Canada)
Linkedin: https://ca.linkedin.com/in/sayedjustetc

Blog: http://Bangla.SaLearningSchool.com, http://SitesTree.com
Online and Offline Training: http://Training.SitesTree.com

Get access to courses on Big Data, Data Science, AI, Cloud, Linux, System Admin, Web Development and Misc. related. Also, create your own course to sell to others to earn a revenue.
http://sitestree.com/training/

If you want to contribute to the operation of this site (Bangla.SaLearn) including occasional free and/or low cost online training (using Zoom.us): http://Training.SitesTree.com (or charitable/non-profit work in the education/health/social service sector), you can financially contribute to: safoundation at salearningschool.com using Paypal or Credit Card (on http://sitestree.com/training/enrol/index.php?id=114 ).

Affiliate Links: Deals on Amazon :
Hottest Deals on Amazon USA: http://tiny.cc/38lddz

Hottest Deals on Amazon CA: http://tiny.cc/bgnddz

Hottest Deals on Amazon Europe: http://tiny.cc/w4nddz

Magento 2 : installation/configuration/operation issues and Solutions

"The Component Dependency Check status never changes. In some cases, the status of the Component Dependency Check doesn’t change, even after you try to correct issues. In that case, you can either delete or rename files named <magento_root>/var/.update_cronjob_status and <magento_root>/var/.setup_cronjob_status and try running the Component Manager again."

https://devdocs.magento.com/guides/v2.3/comp-mgr/trouble/cman/component-depend.html

Mysql error after upgrading magento 2.3.2 to 2.3.3

Solution to:
SQLSTATE[HY000]: General error: 1419 You do not have the SUPER privilege and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable), query was: CREATE TRIGGER trg_catalog_product_entity_after_insert AFTER INSERT ON catalog_product_entity FOR EACH ROW BEGIN INSERT IGNORE INTO `scconnector_google_feed_cl` (`entity_id`) VALUES (NEW.`entity_id`); END

Sol:
mysql -u root -p set global log_bin_trust_function_creators=1;Worked for me.

Reference: https://community.bitnami.com/t/mysql-error-after-upgrading-magento-2-3-2-to-2-3-3/71536

By

Sayed Ahmed

BSc. Eng. in Comp. Sc. & Eng. (BUET)
MSc. in Comp. Sc. (U of Manitoba, Canada)
MSc. in Data Science and Analytics (Ryerson University, Canada)
Linkedin: https://ca.linkedin.com/in/sayedjustetc

Blog: http://Bangla.SaLearningSchool.com, http://SitesTree.com
Online and Offline Training: http://Training.SitesTree.com

Get access to courses on Big Data, Data Science, AI, Cloud, Linux, System Admin, Web Development and Misc. related. Also, create your own course to sell to others to earn a revenue.
http://sitestree.com/training/

If you want to contribute to the operation of this site (Bangla.SaLearn) including occasional free and/or low cost online training (using Zoom.us): http://Training.SitesTree.com (or charitable/non-profit work in the education/health/social service sector), you can financially contribute to: safoundation at salearningschool.com using Paypal or Credit Card (on http://sitestree.com/training/enrol/index.php?id=114 ).

Affiliate Links: Deals on Amazon :
Hottest Deals on Amazon USA: http://tiny.cc/38lddz

Hottest Deals on Amazon CA: http://tiny.cc/bgnddz

Hottest Deals on Amazon Europe: http://tiny.cc/w4nddz

Update Magento 2 to the latest version

Update Magento 2 to the latest version---https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html

Work with Github large file system
---install: Git-lfs: https://help.github.com/en/github/managing-large-files/installing-git-large-file-storage
---How to work with: https://help.github.com/en/github/managing-large-files/configuring-git-large-file-storage

Sure, had to deal with i.e. work with

By

Sayed Ahmed

BSc. Eng. in Comp. Sc. & Eng. (BUET)
MSc. in Comp. Sc. (U of Manitoba, Canada)
MSc. in Data Science and Analytics (Ryerson University, Canada)
Linkedin: https://ca.linkedin.com/in/sayedjustetc

Blog: http://Bangla.SaLearningSchool.com, http://SitesTree.com
Online and Offline Training: http://Training.SitesTree.com

Get access to courses on Big Data, Data Science, AI, Cloud, Linux, System Admin, Web Development and Misc. related. Also, create your own course to sell to others to earn a revenue.
http://sitestree.com/training/

If you want to contribute to the operation of this site (Bangla.SaLearn) including occasional free and/or low cost online training (using Zoom.us): http://Training.SitesTree.com (or charitable/non-profit work in the education/health/social service sector), you can financially contribute to: safoundation at salearningschool.com using Paypal or Credit Card (on http://sitestree.com/training/enrol/index.php?id=114 ).

Affiliate Links: Deals on Amazon :
Hottest Deals on Amazon USA: http://tiny.cc/38lddz

Hottest Deals on Amazon CA: http://tiny.cc/bgnddz

Hottest Deals on Amazon Europe: http://tiny.cc/w4nddz

Reindex magento data using PHP (Shell) and Command Line

You can go to the shell folder, and run the following to reindex everything

php indexer.php --reindexall

Magento 2 has similar command line features.

php bin/magento indexer:reindex

---
To reindex individually

php yourmagentofolder/shell/indexer.php -reindex catalog_product_attribute
php yourmagentofolder/shell/indexer.php -reindex catalogsearch_fulltext
php yourmagentofolder/shell/indexer.php -reindex catalog_category_flat
php yourmagentofolder/shell/indexer.php -reindex cataloginventory_stock
php yourmagentofolder/shell/indexer.php -reindex catalog_category_product php yourmagentofolder/shell/indexer.php -reindex catalog_product_price
php yourmagentofolder/shell/indexer.php -reindex tag_summary
php yourmagentofolder/shell/indexer.php -reindex catalog_url

Reference:https://magento.stackexchange.com/questions/162166/how-to-reindex-magento-1-x-by-using-command-line
Sure, I also executed these/similar myself...

---

Sayed Ahmed

Linkedin: https://ca.linkedin.com/in/sayedjustetc

Blog: http://Bangla.SaLearningSchool.com, http://SitesTree.com
Online and Offline Training: http://Training.SitesTree.com

If you want to contribute to the operation of this site including occasional free online training (using Skype, Zoom.us): http://Training.SitesTree.com (or charitable/non-profit work in the education sector), you can financially contribute to: safoundation at salearningschool.com using Paypal. Sometime, we also provide

Affiliate Links:
Hottest Deals on Amazon USA: http://tiny.cc/38lddz

Hottest Deals on Amazon CA: http://tiny.cc/bgnddz

Hottest Deals on Amazon Europe: http://tiny.cc/w4nddz

Did you every wonder why your product is not showing up in a category in Magento?

"

Magento 2 Product Visibility Grid

Did you every wonder why your product is not showing up in a category in Magento?

Magento has a complex way of building a product collection. Due to several conditions, indexes, plugins and other complexities determining whether a product should show is not that straightforward."

Details and Tools/Modules:
https://github.com/Itonomy/magento2-product-visibillitygrid

Administering Magento 2

Magento 2 file/folder permissions setting

https://magehit.com/blog/magento-2-file-folder-permissions-setting/

Magento 2: Run Unit Tests

https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-test.html

Install M2E PRO via Magento Marketplace

https://docs.m2epro.com/display/InstallationUpgradeMagento2/via+Magento+Marketplace

M2E Pro - installation options

https://docs.m2epro.com/display/InstallationUpgradeMagento2/Home

Magento 2: Cron Configuration

https://firebearstudio.com/blog/magento-2-cron-configuration.html

Upgrade magento from 2.3.1 to 2.3.2

Upgrade Magento from 2.3.1 to 2.3.2

From 2.3.0 to 2.3.2 should also work; from some other earlier versions may or may not work..

A very similar approach worked for me (Note: I have no interest to work in the industry with Magento). Also, after upgrade, check the error log and/or system log files. if you see any issues there fix those. You most probably have to compile as well. Also, you have to adjust write permissions for generated folder and var/cache folder if not done already. compiling just after setup:upgrade or after :deploy : both should work.

"


sudo chmod +x bin/magento
sudo php bin/magento maintenance:enable sudo composer require magento/product-community-edition 2.3.2 --no-update sudo composer update sudo rm -rf var/cache/ sudo rm -rf generated/ sudo chmod +x bin/magento sudo php bin/magento setup:upgrade sudo php bin/magento setup:static-content:deploy -f sudo php bin/magento indexer:reindex sudo php bin/magento maintenance:disable

Compile command is similar to:

sudo php bin/magento setup:di:compile

"

Reference: https://magento.stackexchange.com/questions/282452/upgrade-magento-2-3-1-to-2-3-2

"

Magento 2: Misc Stuff

How to Upgrade Magento Version from 2.2.x to 2.3.0?

http://www.codextblog.com/magento-2/upgrade-magento-version-2-2-x-2-3-0/

---

Back up and roll back the file system, media, and database

https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-backup.html

---
System Upgrade: conflicting component dependencies

https://community.magento.com/t5/Magento-2-x-Version-Upgrades/System-Upgrade-conflicting-component-dependencies/td-p/27404

---

Set the Magento mode

https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-mode.html

---

Command-line upgrade

https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html

---

Update and upgrade checklist

https://devdocs.magento.com/guides/v2.3/comp-mgr/prereq/prereq_compman-checklist.html

---

dry run example

https://github.com/magento/magento2/issues/4055

---

DOWNLOAD RELEASES, PATCHES AND TOOLS

https://magento.com/tech-resources/download

--

How to decompress a .bz2 file

https://superuser.com/questions/480950/how-to-decompress-a-bz2-file

---

Magento 2.3 technology stack requirements

https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html

---

Magento 1 to Magento 2: Migration Tools and Steps

Upgrade Magento:

https://docs.bitnami.com/aws/apps/magento/administration/upgrade/

Bitnami Docker Magento: [not that important] [AWS uses Bitnami Magento Image]
https://github.com/bitnami/bitnami-docker-magento

https://bitnami.com/stack/magento

https://aws.amazon.com/marketplace/pp/Bitnami-Magento-Certified-by-Bitnami/B00NNZTA6Y

Install Data Migration Tool
https://devdocs.magento.com/guides/v2.3/migration/migration-tool-install.html

https://mage2-blog.com/magento-2-data-migration-tool/

Steps for Migration
https://www.netsolutions.com/insights/how-to-migrate-from-magento-1-to-magento-2/

Misc Info on : How to select a small cloud/VPS hosting plan

Plesk (Hosting/Cloud-Hosting Control Panel) is not free; however, VPS provider such as Vultr might offer Web Admin SE version for free
Plesk Documentation and Help Portal
https://docs.plesk.com/en-US/onyx/deployment-guide/79348/
--
AWS lightsail looks to be a good choice for very small cloud based hosting. For VPS
Price starting at USD 3.50/month, though $5 plan might be the minimum plan that anyone needs to go with
Though have seen Vultr, Upcloud, Digital Ocean $5 plan outperform AWS lightsail for $5 plans
---
Comparisons:
June 2019 - DigitalOcean vs. Lightsail vs. Linode vs. UpCloud vs. Vultr
https://joshtronic.com/2019/06/03/vps-showdown-digitalocean-lightsail-linode-upcloud-vultr/
Finds upcloud to be the top one, though digitalocean still gets good points.
Though can be biased. Better to check for yourself. I probably did not get impressed at least for usability of the initial screens and options
---
I am personally more biased towards AWS Lightsail and Vultr - though in the above comparison Vultr performance is mixed in terms of speed related metrics; same for AWS light sail. AWS lightsail has more storage though. Giving the options at deployment such as option for a control panel, and open source apps - I found better in Vultr and Lightsail. Though WHM/Cpanel or similar, Centos 7, Magento, Python Tools were my primary areas of concerns. Upcloud, and digital ocean seem lacked there. Though digital ocean gives many more options for other tools where Vultr provides a balance. I did not feel good about upcloud so far. AWS in general not the Lightsail will give way more options than the others; however, we are talking about small and simple plans.
---
Magento on Ubuntu : How to
https://upcloud.com/community/tutorials/install-magento-open-source-ubuntu/
You might find magento come bundled with Ubuntu and can install in one click. Both for AWS light sail and Vultr. Did not see for Digital Ocean

You might want to see articles on this web-site that discussed Magento 2 installation. Go couple of articles this way or other using the navigation (article base, next, prev)

Sayed Ahmed

Linkedin: https://ca.linkedin.com/in/sayedjustetc

Blog: http://sitestree.com, http://bangla.salearningschool.com

Learn some CentOS Linux : Redhat Linux

This is mostly about Centos Linux. However, this also shows commands related to how to install Magento 2 on LEMP (E for Nginx Web-server). Some PHP related stuff are there as well.

LEMP + CentOS + Magento 2 : VM Image or one click install: I did not see readily available on Upcloud, AWS Lightsail, Vultr, and Digital Ocean. I might share the Image for this cloud instance. Magento 2 + Ubuntu is there; though not with CentOS.

1 php -v

2 systemctl status nginx
3 systemctl status httpd

5 systemctl status mysql
6 mysql
8 yum update
9 reboot

Create SWAP
10 fallocate -l 1G /swapfile

12 chmod 600 /swapfile
13 mkswap /swapfile

15 swapon /swapfile

Make swap permanent
16 vi /etc/fstab
17 /swapfile swap swap defaults 0 0
18 swapon --show

Check disk spaces
19 free -h
20 cat /proc/sys/vm/swappiness
21 cat /etc/fstab
22 swapon --show
23 free -h
24 cat /proc/sys/vm/swappiness
25 sysctl vm.swappiness=10
26 vi /etc/sysctl.conf

Create a user: Better not to work as root

27 useradd sahmed
30 passwd sahmed

Assign sahmed to wheel group i.e. make sahmed as sudo

31 usermod -aG wheel sahmed

33 su - sahmed
34 mysql -u root -p
35 mysql

Install PHP Modules as will be required by Magento and by many other PHP based applications and frameworks

36 sudo yum install php-mysql php-opcache php-xml php-mcrypt php-gd php-soap php-redis php-bcmath php-intl php-mbstring php-json php-iconv php-fpm php-zip
37 vi configure.sh
38 su - sahmed
39 reboot

PHP-FPM is faster
40 systemctl restart php-fpm
41 sudo su - magento
42 sudo chmod 750 /opt/magento
43 sudo su - magento
44 sudo systemctl restart php-fpm
45 sudo su - magento
46 vi /etc/php.ini
47 su - magento

ext-intl, and php-intl might give you a hard time

48 yum -y install ext-intl
49 yum -y install php*intl
50 yum -y list php*intl
51 yum -y install php-intl.x86_64
52 yum -y list php*intl
53 yum -y install php72u-intl.x86_64

Couple of above lines might not work or might not give good results

Creating a user for magento though not required. You can create any sudo user other than root (better not to use root)

54 sudo su - magento
55 exit
56 su - root
57 su - magento
58 su - sahmed

60 yum -y install php72*

The above line will help a lot : 60. Will install many of the required packages though might install some more

61 yum update
62 yum makecache
63 su - sahmed
64 reboot
65 su
66 su - magento
67 vi /etc/php.ini
68 systemctl restart php-fpm
69 su - magento
70 systemctl reload php-fpm
71 systemctl restart php-fpm
72 su -
73 mysql
74 history | grant
75 mysql
76 sudo su - sahmed

Configure your domain under nginx web-server

77 vi /etc/nginx/nginx.conf
78 vi /etc/nginx/conf.d/shopforsoul.com.conf
79 systemctl reload nginx
80 ping shopforsoul.com
81 ping shopforsoul.com

82 ifconfig
83 hostname

lynx a web-browser
84 lynx shopforosul.com
85 yum -y install lynx
86 lynx shopforosul.com

Check access and error log: why not working
87 ls /var/log/nginx/access.log
88 tail /var/log/nginx/access.log
89 tail /var/log/nginx/error.log
90 vi /etc/nginx/conf.d/shopforsoul.com
91 tail /var/log/nginx/error.log

Issues were there related to lets encrypt i.e. ssl. as I modified /etc/hosts and assigned the cloud instance to the domain. domain is pointing to a different ip in reality. though used the domain so that I can test. later the domain DNS can be just changed to this cloud instance

On config files, duplicates entries were for the domain i.e. duplicate server {}
also under server: some lines were related to let's encrypt and ssl ports. commented thouse out
Let's encrypt command as used here will work for sure. Last line for let's crypt might not work as DNS for the domain in real life points to another IP. when this is adjusted everything will work

92 vi /etc/nginx/conf.d/default.conf
93 systemctl reload nginx
94 systemctl restart nginx
95 tail /var/log/nginx/error.log
96 vi /etc/nginx/conf.d/shopforsoul.com
97 rm /etc/nginx/conf.d/shopforsoul.com
98 vi /etc/nginx/conf.d/shopforsoul.com.conf
99 systemctl restart nginx
100 systemctl reload nginx
101 vi /etc/nginx/conf.d/shopforsoul.com.conf
102 pwd
103 cd /opt/magento/public_html/
104 ls
105 ls app/etc/env.php
106 vi app/etc/env.php

Check what is the admin url for magento 2

107 php bin/magento info:adminuri
108 history > /home/sahmed/magento_install_history.txt

----

The following commands were also used as part of installing Magento 2. However, under the user sahmed.

1 sudo ls -l /root

3 systemctl status php-fpm

PHP repos: remi is one, ius is another.

4 yum repolist | grep epel
5 yum repolist
6 epel/x86_64

This is let's encrypt and SSL. You might want to do this before configuring Nginx and also before starting to install magento. Though remember, the domain will need to be a live one with proper DNS settings.

7 yum install certbot
8 sudo yum install certbot
9 sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
10 sudo mkdir -p /var/lib/letsencrypt/.well-known
11 sudo chgrp nginx /var/lib/letsencrypt
12 sudo chmod g+s /var/lib/letsencrypt
13 sudo mkdir /etc/nginx/snippets
14 cat /etc/nginx/snippets/letsencrypt.conf
15 vi /etc/nginx/snippets/letsencrypt.conf
16 sudo vi /etc/nginx/snippets/letsencrypt.conf
17 cat /etc/nginx/snippets/ssl.conf
18 vi /etc/nginx/snippets/ssl.conf
19 sudo vi /etc/nginx/snippets/ssl.conf
20 cat /etc/nginx/conf.d/shopforsoul.com
21 sudo vi /etc/nginx/conf.d/shopforsoul.com
22 sudo systemctl reload nginx
23 sudo certbot certonly --agree-tos --email sahmed --webroot -w /var/lib/letsencrypt/ -d shopforsoul.com

The above line though a must might fail if domain/DNS not appropriate

24 mysql -u root -p
25 mysql
26 sudo mysql
27 exit
28 sudo rm -f /opt/magento/public_html/*
29 sudo su ma- gento
30 sudo su - magento
31 exit

Adjust configurations as are important for Magento 2
32 sudo sed -i "s/memory_limit = .*/memory_limit = 756M/" /etc/php.ini
33 sudo sed -i "s/upload_max_filesize = .*/upload_max_filesize = 256M/" /etc/php.ini
34 sudo sed -i "s/zlib.output_compression = .*/zlib.output_compression = on/" /etc/php.ini
35 sudo sed -i "s/max_execution_time = .*/max_execution_time = 18000/" /etc/php.ini
36 sudo sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php.ini
37 sudo sed -i "s/;opcache.save_comments.*/opcache.save_comments = 1/" /etc/php.d/10-opcache.ini

Use composer to install Magento 2
38 curl -sS https://getcomposer.org/installer | php
39 sudo mv composer.phar /usr/local/bin/composer
40 sudo useradd -m -U -r -d /opt/magento magento
41 sudo usermod -a -G magento nginx
42 sudo chmod 750 /opt/magento
43 cat /etc/php-fpm.d/magento.conf
44 vi /etc/php-fpm.d/magento.conf
45 sudo vi /etc/php-fpm.d/magento.conf
46 sudo systemctl restart php-fpm
47 sudo su - magento
48 yum install php-intl
49 sudo yum install php-intl
50 php -v

52 sudo yum install php-pecl-intl

54 yum install php-intl

56 sudo yum update

59 sudo yum makecache
60 sudo yum update

68 php -v
69 sudo systemctl restart nginx
70 sudo systemctl restart php

75 sudo yum install --skip-broken php-intl
76 sudo yum -y install php-common
77 sudo yum -y --skip-broken install php-common
78 sudo yum install --skip-broken php-intl
79 sudo yum install php-intl
80 sudo yum install --skip-broken php-intl

better try not to use the --skip-broken option
yum -y install php72* helped a lot to fix missing package issue. You can ignore yum install php-intl ext-intl php72-intl or similar. yum -y install php72* is the solution

Creating another user for magento 2
81 su - magento
82 sudo su - magento
83 reboot
84 exit
85 su - magento
86 sudo su - magento
87 exit
88 sudo su - magento
89 exit

91 sudo su - magento
92 sudo vi /etc/nginx/conf.d/shopforsoul.com.conf
93 su - magento
94 exit
95 sudo su - magento
96 exit
97 history | grep encrypt
98 history

--

Some commands as executed with user Magento
1 ls /opt/
2 ls /opt/magento/
3 ls /opt/magento/public_html/
4 ls /opt/magento/public_html/ -la

where I kept Magento: /opt/magento/public_html/

5 rm -rf .*
6 rm -rf *.*

You might need rm for cases installation fails and you need to reinstall

7 ls /opt/magento/public_html/ -la
8 rm .gitignore
9 pwd
10 rm -rf /opt/magento/public_html/.*
11 ls /opt/magento/public_html/ -la
12 composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition /opt/magento/public_html

Use public key as user id
use private key as password

13 php -i
14 php -i | grep php.ini
15 vi php.ini
16 exit

You know repeating as things went wrong esp. missing packages for php

17 composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition /opt/magento/public_html
18 rm -rf /opt/magento/public_html/*
19 rm -rf /opt/magento/public_html/.*
20 composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition /opt/magento/public_html
21 exit
22 rm -rf /opt/magento/public_html/.*
23 composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition /opt/magento/public_html
24 rm -rf /opt/magento/public_html/.*
25 rm -rf /opt/magento/public_html/*
26 composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition /opt/magento/public_html
27 yum repolist | grep php72
28 yum list | grep php72
29 exit
30 rm -rf /opt/magento/public_html/*
31 composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition /opt/magento/public_html
32 rm -rf /opt/magento/public_html/*
33 rm -rf /opt/magento/public_html/.*
34 composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition /opt/magento/public_html
35 exit
36 cd ~/public_html/
37 ls

This is how you install magento 2

38 php bin/magento setup:install --base-url=sayedum" --admin-user="shopforsoul" --admin-password="" --db-name="magento" --db-host="localhost" --db-user="magento" --currency=USD --timezone=America/Chicago --use-rewrites=1 --db-password=""

Crontab for Magento System Tasks

39 php ~/public_html/bin/magento cron:install
40 crontab -l
41 vi /etc/nginx/conf.d/shopforsoul.com.conf
42 sudo vi /etc/nginx/conf.d/shopforsoul.com.conf
43 exit
44 systemctl reload nginx
45 exit
46 history

Misc Linux Commands (CentOS/Redhat) that you might find useful

1 php -v
2 yum repolist
3 yum repolist | remi
4 yum repolist | grep remi
5 yum repolist | grep ius
6 yum makecache
7 yum update
8 reboot
9 adduser ariro
10 passwd ariro
11 usermod -a -G apache ariro
12 adduser magento
13 passwd magento
14 usermod -a -G apache magento
15 mysql
16 mysql -u magento -p magentodb
17 mkdir /var/www/magento
18 exit
21 ls
20 mv Magento-CE-2.3.2-2019-06-13-03-23-52.tar.gz /var/www/magento/
21 cd /var/www/magento

23 gunzip Magento-archive.tar.gz
24 ls
25 ls -la
26 tar zxvf Magento-CE-2.3.2-2019-06-13-03-23-52.tar.gz
27 chown -R magento:apache /var/www/magento
28 cd /etc/httpd/conf
29 nano httpd.conf
30 apachectl configtest
31 systemctl reload httpd
32 cd /var/www/magento
33 find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
34 find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
35 chmod u+x bin/magento
36 chown -R magento:apache /var/www/magento
37 apachectl configtest
38 systemctl reload httpd
39 ls -la index.php
40 chmod +x *.php
41 ls -la index.php
42 apachectl status apache
43 apachectl restart apache
44 php bin/magento setup:install
45 php bin/magento setup:install --base-url=sayedum" --admin-user="magento" --admin-password="UYDR5-q19b1" --db-name="magento" --db-host="localhost" --db-user="magento" --currency=USD --timezone=America/Chicago --use-rewrites=1 --db-password="-"
46 yum install php-intl
47 php bin/magento setup:install
48 php bin/magento setup:install --base-url=sayedum" --admin-user="magento" --admin-password="UYDR5-q19b1" --db-name="magento" --db-host="localhost" --db-user="magento" --currency=USD --timezone=America/Chicago --use-rewrites=1 --db-password="-"
49 yum install php72-intl
50 ls -la
51 ls -la index*
52 vi /etc/httpd/conf/httpd.conf
53 apachectl restart apache
54 ls /var/www/magento/
55 vi /etc/httpd/conf/httpd.conf
56 apachectl restart apache
57 apachectl restart jttpd
58 apachectl restart httpd
59 systemctl reload httpd
60 systemctl restart httpd
61 reboot

62 cp -R /var/www/magento/* /var/www/html/
63 systemctl restart httpd
64 systemctl reload httpd
65 cd /var/www/html/
66 ls index.php
67 ls -la index.php
68 chmod +x *.php
69 ls cd /var/www/magento
70 find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
71 find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
72 chmod u+x bin/magento
73 cd /var/www/html/
74 find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
75 cat /etc/httpd/conf.d/http.conf
76 cp /etc/httpd/conf.d/http.conf /etc/httpd/conf.d/http.conf.var.www.html
77 vi /etc/httpd/conf.d/http.conf
78 vi /var/default-conf/httpd/conf.d
79 vi /var/default-conf/httpd/conf/httpd.conf
80 history
81 history > history.txt

Centos: yum : centos-web-control-panel: install magento 2:

----
"yum upgrade and yum update will perform the same function that update to the latest current version of package. But the difference is Upgrade will delete obsolete packages, while update will preserve them.Jul 3, 2014"
https://unix.stackexchange.com/questions/55777/in-centos-what-is-the-difference-between-yum-update-and-yum-upgrade
---
3.3. UPDATING PACKAGES FROM THE COMMAND LINE WITH YUM
https://access.redhat.com/documentation/en-us/red_hat_network_satellite/5.5/html/reference_guide/sect-reference_guide-package_updater-updating_packages_from_the_command_line_with_yum
---
yum install package_name
yum update package_name
yum check-update
yum remove package_name
yum provides package_name
yum search keyword
yum localinstall absolute path to filename

Reference: the above link
---
20 Linux YUM (Yellowdog Updater, Modified) Commands for Package Management
https://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/
---
How to create a new domain account with CENTOS Webpanel
https://www.techrepublic.com/article/how-to-create-a-new-domain-account-with-centos-webpanel/
---
How to install Plesk for Linux
https://support.plesk.com/hc/en-us/articles/213415669-How-to-install-Plesk-for-Linux
---
Comprehensive: Install Magento 2 on CentOS 7
https://linuxize.com/post/install-magento-2-on-centos-7/
---
How To Install Magento 2 on CentOS 7 In 10 Minutes
https://bash-prompt.net/guides/install-magento-centos/
---
HOW TO INSTALL MAGENTO 2 ON CENTOS
https://magenest.com/en/how-to-install-magento-2-on-centos/

Sayed Ahmed

Linkedin: https://ca.linkedin.com/in/sayedjustetc

Blog: http://sitestree.com, http://bangla.salearningschool.com

Use custom email server for Magento based ecommerce shops

Use custom email server for Magento based ecommerce shops

You will need to change code on the file : app/code/core/Mage/Core/Model/Email/Template.php

Comment out the existing getMail() method.

And replace the method with the following code.

Remember: changing the core Magento code is not the greatest idea as upgrade of Magento will eventually become a big issue at a later time (if you keep doing this).

You can consider this as a quick test if you can make external mail server working with magento. However, ideally you need to take a better approach.

public function getMail()
    {
        if (is_null($this->_mail)) {

            /*Start of added code to specify config*/
            $my_smtp_host = Mage::getStoreConfig('system/smtp/host');
            $my_smtp_port = Mage::getStoreConfig('system/smtp/port'); 

            $config = array(
                    'ssl' => 'tls',
                    'port' => $my_smtp_port,
                    'auth' => 'login',
                    'username' => 'account@gmail.com',
                    'password' => 'secret'
            );

            $transport = new Zend_Mail_Transport_Smtp($my_smtp_host, $config);

            Zend_Mail::setDefaultTransport($transport);
            /*End of added code to specify config*/

            $this->_mail = new Zend_Mail('utf-8');
        }
        return $this->_mail;
    }
https://stackoverflow.com/questions/11558156/magento-how-enable-smtp-server-authentication-and-secure-transport


Sayed Ahmed
647-624-8509, sayedum

Linkedin: https://ca.linkedin.com/in/sayedjustetc

Blog: http://sitestree.com, http://bangla.salearningschool.com

PHP ক্যারিয়ার গঠন

PHP ক্যারিয়ার গঠন
নাভিদ তাসনিম

PHP অর্থাৎ Hypertext Preprocessor হলো একটি সার্ভার সাইড, একটি HTML Embedded স্ক্রিপ্টিং সাইড।একজন ভালো ওয়েব ডিজাইনার হতে PHP শেখা খুবই গুরুত্বপূর্ণ।প্রশ্ন হচ্ছে আপনি যদি অভিজ্ঞ PHP ক্যারিয়ার গঠন করতে চান তবে আপনার কি কি জানা প্রয়োজন?

টুলস এবং ফ্রেমওয়ার্ক :

1. CakePHP ফ্রেমওয়ার্ক শিখুন।
http://cakephp.org/

2. বিভিন্ন IDE যেমন Zend Studio,Aptana,Borland Delphi IDE for PHP,P4A IDE,Eclipse PDT,Dreamweaver ইত্যাদি এর ব্যবহার জানুন ।জেন্ড স্টুডিও থেকে টুলস এবং ফ্রেমওয়ার্ক সম্পর্কে ভালভাবে শিখে নিন।
http://www.zend.com/products/studio/

3. PHP বাদে আপনি কি চাকরি খুঁজছেন? অথবা আপনার পছন্দের চাকরি বেছে নিতে পারছেন না? তাহলে আপনার এ বিষয়ে আরো জানা প্রয়োজন।আর যদি আপনার নির্দিষ্ট চাকরি থাকে, তাহলে আপনি একটি IDE এর উপর মনোনিবেশ করতে পারেন।ড্রুপাল এবং জুমলার ব্যবহার শিখুন।

4. Directory Codes সম্পর্কে ভাল ধারনা রাখা প্রয়োজন।CMSes গুলোর ডাটাবেস স্ট্রাকচার সম্পর্কেও ভালভাবে জানুন।

5. PHP ক্যারিয়ারে দক্ষতা অর্জনে আপনাকে অবশ্যই HTML,CSS,JavaScript,MySQL & XHTML সম্পর্কে জানতে হবে।SITEBUILDER এর বইগুলো এ ব্যাপারে আপনাকে সাহায্য করতে পারে।

6. মনেরিস, পেপাল, অথরাইজ, মিরাসার্ভ-বিভিন্ন অনলাইন পেমেন্ট পদ্ধতি সম্পর্কে জেনে নিন।

7. Magento,OScommerce,Ubercart সাইটগুলো আপনাকে লিনাক্স/অ্যপাচী প্ল্যাটফর্মের ওয়েব হোস্টিং সম্পর্কে ধারনা দেবে।

8. PHP সম্পর্কে অনুশীলন করতে Ebay থেকে কমদামে PHP স্ক্রীপ্ট কিনে নিতে পারেন।এরপর এগুলোর উপর নানান এক্সপেরিমেন্ট চালাতে পারেন।

9. সর্বোপরি Photoshop XML Manipulation,XSS এবং বিভিন্ন PHP Applications ব্যবহার ও ডিপ্লয়িং জানুন যা আপনাকে PHP তে আরো দক্ষ করে তুলবে।

আপনার কি PHP ক্যারিয়ার গঠন করা উচিত? নিচের লিংকগুলো দেখুন-

Reference:

http://salearningschool.com/displayArticle.php?table=Articles&articleID=1147&title=How%20to%20build%20a%20career%20in%20PHP