Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the copy-the-code domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pb-seo-friendly-images domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the johannes domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121
How to Install Magento 2.4.5 on CentOS (Complete Guide) - PC✗3
How to Install Magento 2.4.5 on CentOS (Complete Guide)

How to Install Magento 2.4.5 on CentOS (Complete Guide)

In this guide, I will be installing Magento 2.4.5 on a cPanel server where ElasticSearch has been installed. Before proceeding to the next step make sure that you are using a supported PHP version and have all required extensions enabled.

  • Step 1. Get Private and Public keys
  • Step 2. Create a new project
  • Step 3. Create a database
  • Step 4. Install Magento

Get Private and Public keys

Login to https://marketplace.magento.com/customer/accessKeys/ to get private and public access key:

image 1 - How to Install Magento 2.4.5 on CentOS (Complete Guide)
  • Public Key = Username
  • Private Key = Password
image 2 - How to Install Magento 2.4.5 on CentOS (Complete Guide)

Create a project

On the server where Magento 2.4.5 will be installed run the following command:

sudo composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.5 magento2
image 1024x173 - How to Install Magento 2.4.5 on CentOS (Complete Guide)

Change file permissions:

find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
chown -R user_name:www-data .
chmod u+x bin/magento

Create a new database

Then create a new Database to be used by Magento.

https://docs.cpanel.net/cpanel/databases/mysql-database-wizard/

Save the database name, username and password for the next step.


Install Magento

After the database has been created run the following to install Magento:

php bin/magento setup:install --base-url=<your-domain> --db-host=localhost --db-name=magento2 --db-user=magento2 --db-password=<your-db-password-of-magento2-user> --admin-firstname=Admin --admin-lastname=Admin --admin-email=admin@admin.com --admin-user=admin --admin-password=<your-admin-password> --language=en_US --currency=USD --timezone=America/Chicago --backend-frontname=admin --search-engine=elasticsearch7 --elasticsearch-host=localhost --elasticsearch-port=9200
image 3 - How to Install Magento 2.4.5 on CentOS (Complete Guide)

Next, you will need to run these commands to upgrade the database and deploy static view files

php bin/magento indexer:reindex && php bin/magento se:up && php bin/magento se:s:d -f && php bin/magento c:f && php bin/magento module:disable Magento_TwoFactorAuth
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.