Table of Contents
Introducing Magento 2 is never a simple errand. Since the absolute first delivery, there are numerous issues clients may experience when introducing Magento 2.
With the most recent arrival of Magento 2.4.3, things have gotten more earnestly as Magento 2 currently, requires Elasticsearch as a compulsory part.
To make a Magento 2 establishment work appropriately in the Production climate, clients are prescribed to introduce Magento 2 in localhost first. At that point move the neighborhood establishment to a Magento 2 facilitating and update storeβs Baseurl, and reindex Magento 2.
In this instructional exercise, we will experience the way toward introducing Magento 2 (with Elasticsearch) in Ubuntu.
If you are also want to install Magento2 on Windows. Click Here.
Contents-
- Step 1: Install Apache2
- Step 2: Install MySQL and Create Database for Magento2
- Step 3: Install PHP and required extensions
- Step 4: Install and configure Elasticsearch
- Step 5: Install Composer
- Step 6: Download and Install Magento2
- Wrapping up
Before starting the installation, you can check theΒ system requirement for installing Magento2 here.
Step 1: Install Apache2
First, we will install Apache web server. Connect to your server using ssh protocol with root access and run this command:
Apache is available in Ubuntuβs default software repositories. For this reason, weβll start by updating the local package index for the latest changes.
sudo apt update
Then, lets install the apache2Β package.
sudo apt install apache2
The system will ask to continue yes/no. Input βyβ then enter to proceed.
Once installed, you can check the installed Apache version with the following command:
sudo apache2ctl -v
To verify if apache2 was install properly, in your browser, enter your domain or ip address or 127.0.0.1. If the result is apache default page => everything is fine
To enable auto startup for apache, use this command:
systemctl is-enabled apache2
Step 2: Install MySQL and Create Database for Magento2
Install MySQL using apt command:
sudo apt install mysql-server
When prompted, typingΒ Y
Β to confirm installation and then pressΒ ENTER
.
When the installation is complete, lets check the mysql version
Configure Password Access for the MySQL Root Account
Login with root user.
sudo mysql
SELECT user,authentication_string,plugin,host FROM mysql.user;
Note: Replace βyour_secure_password β with your password. |
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_secure_password';
exit
Create new MySQL user for Magento 2
Login with root user.
mysql -u root -p
SELECT user,authentication_string,plugin,host FROM mysql.user;
Note: Replace βyour_secure_password β with your password. |
CREATE USER 'magento2'@'localhost' IDENTIFIED BY 'your_secure_password';
ALTER USER 'magento2'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_secure_password';
Grant all privileges toΒ magento2
Β users.
GRANT ALL PRIVILEGES ON *.* TO 'magento2'@'localhost' WITH GRANT OPTION;
exit
Create Magento 2 database
Lets create the database for our magento2: –
mysql -u magento2 -p
Then create
CREATE DATABASE magento2;
exit
Step 3: Install PHP and required extensions
In this step, we will install PHP.Β Magento 2.4Β require PHP 7.4, so we will install php 7.4 in this tutorial.
Update your APT repositories.
sudo aptΒ update
Install PHP 8.1 and packages with command:
sudo apt install php8.1 libapache2-mod-php php-mysql
Next, verify your PHP version:
php -v
sudo nano /etc/apache2/mods-enabled/dir.conf
Modify the index.php file order to the top listed in the DirectoryIndex.
The dir.conf file after modifying will look like this:
Install and enableΒ mbstring
Β extension.
sudo apt install php8.1-mbstring
sudo phpenmod mbstring
Enable the Apache rewrite module.
sudo a2enmod rewrite
Install PHP modules for Magento 2.4.x.
sudo apt install php8.1-bcmath php8.1-intl php8.1-soap php8.1-zip php8.1-gd php8.1-curl php8.1-cli php8.1-xml php8.1-xmlrpc php8.1-gmp php8.1-common
Reload Apache for the changes to take effect.
sudo systemctl reload apache2
Configure php settings
php -i | grepΒ "Configuration File"
From this command, you will get path to the php.ini file. Open this file to modify some settings:
sudo nano <path_of_php.ini_file>
In php.ini file, search and change the following values as below
max_execution_time=18000 max_input_time=1800 memory_limit=4G
Save the file. Reload Apache2.
sudo systemctl reload apache2
These values will keep the installation go properly without interruption.
Step 4: Install and configure Elasticsearch
From Magento 2.4, Elasticsearch has become compulsory component. From Magento 2.4, catalog search will no longer use mysql, instead the system will use Elasticsearch by default.
So let’s install and configure it.
Install Elasticsearch
First, we will install Openjdk17 (Java) as Elasticsearch runs on Java:
sudo apt install openjdk-17-jdk
Next, verify if the java was installed properly and check its version with this syntax
java -version
The first step is toΒ import the GPG keyΒ for Elasticsearch packages using the following command:
sudo apt install curl
Once done, run below command:-
sudo curl -sSfL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --no-default-keyring --keyring=gnupg-ring:/etc/apt/trusted.gpg.d/magento.gpg --import
Then you need toΒ add Elasticsearch repositoryΒ to the system using the following command:
sudo sh -c 'echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list'
sudo chmod 666 /etc/apt/trusted.gpg.d/magento.gpg
After completing the above steps, you must firstΒ update the cacheΒ using the following commands. ThenΒ install Elasticsearch packagesΒ on the system:
sudo apt update
sudo apt install elasticsearch
Finally, you can use the following commandsΒ StartΒ andΒ enableΒ the Elasticsearch service:
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
Configure Elasticsearch
Once the elasticsearch has been installed on your system, open the elasticsearch.yml configuration file.
Now that you have installed Elasticsearch and its Java dependency, it is time to configure Elasticsearch.
The Elasticsearch configuration files are in theΒ /etc/elasticsearch
directory. The ones weβll review and edit are:
elasticsearch.yml
Β β Configures the Elasticsearch server settings. This is where most options are stored, which is why we are mostly interested in this file.jvm.options
β Provides configuration for the JVM such as memory settings.
The first variables to customize on any Elasticsearch server are node.name
Β andΒ cluster.name
Β inΒ elasticsearch.yml
. Letβs do that now.
As their names suggest,Β node.name
Β specifies the name of the server (node) and the cluster to which the latter is associated. If you donβt customize these variables, aΒ node.name
Β will be assigned automatically in respect to the server hostname. TheΒ cluster.name
Β will be automatically set to the name of the default cluster.
TheΒ cluster.name
Β value is used by the auto-discovery feature of Elasticsearch to automatically discover and associate Elasticsearch nodes to a cluster. Thus, if you donβt change the default value, you might have unwanted nodes, found on the same network, in your cluster.
Letβs start editing the mainΒ elasticsearch.yml
configuration file. Open it usingΒ nano
Β or your preferred text editor:
sudo nano /etc/elasticsearch/elasticsearch.yml
Remove theΒ #
Β character at the beginning of the lines forΒ node.name
Β andΒ cluster.name
Β to uncomment them, and then change their values. Your first configuration changes in theΒ /etc/elasticsearch/elasticsearch.yml
Β file will look like this:
...
Now we have finished installing Elasticsearch.
Now let’s install next component – Composer.
Step 5: Install Composer
In this tutorial, we will install Magento 2.4 using composer. First, run this command to download composer installer.
Move back to the root directory.
cd ~
curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/bin --filename=composer
Let’s check the composer version.
composer
Our composer version is 2.1.6.Β Now we are ready toΒ download Magento 2.4Β using composer.
Step 6: Download and Install Magento2
Download Magento2:-
Go toΒ html
Β folder by command:
cd /var/www/html
Create a new Composer project using the Magento Open Source or Magento Commerce metapackage.
Command for this is :-
sudo composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.5 magento2
For Magento 2.4.6
sudo composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.6 magento2
Create Access keys here. If you have access keys, you can use those.
Now enterΒ UsernameΒ
Β andΒ password
Β to start downloading
- Username: Your public KeyΒ 2fc966a913d4e83b28041eeb3c3b72e5
- Password: Your private key. 48e05400d17ca1bcb4e693825c45416e
You will see this screen if everything is fine. Now just wait some minutes, composer is download Magento 2 to your server
Wait the process to complete.
Set file permissions
cd /var/www/html/<magento install directory>
sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + sudo find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} + sudo chown -R user_name:www-data . sudo chmod u+x bin/magento
sudo chown -R user_name:www-data .
Β => user_name is the user with root accessInstall Magento 2
Everything is ready, now we will run the final command to install Magento 2.4
First, change the current directory to your website folderΒ (this is also where you downloaded Magento 2 data in step 3)
Go to Magento 2 install directory.
cd /var/www/html/<magento install directory>
You must use the command line 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
Replace the following information with your information
--base-url
: your domain, eg: sonal.magento.com
. You can change this base URL later if you make mistake.
--db-host
Β : Database host, inputΒ localhost
Β if you follow my tutorial
--db-name
Β : name of the database we created in step 2
--db-user
Β : name of the database user we created in step 2
--db-password
Β : password of your mysql user
Now composer will start installing Magento 2.4. The process will take a while (approximately 20 minutes)
Wait until the installation is successful.
When everything is done you will see this
Congratulation, Magento 2.4 was successfully installed to your ubuntu server.
Change DocumentRoot To Pub
If you append a directory name to your serverβs hostname or IP address to create the base URL when you installed Magento (for example http://<your-ip>/magento2 or http://<your-sever-hostname>/magento2), youβll need to remove it.
Edit your virtual host file
sudo nano /etc/apache2/sites-available/sonal.magento.com
.conf
Add the path to your MagentoΒ pub/
Β directory to theΒ DocumentRoot
directive:
Modify file as shown below:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/magento2/pub
Β Β Β Β Β ServerName
Β sonal.magento.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/html">
AllowOverride all
</Directory>
</VirtualHost>
Restart Apache for the changes to take effect:
sudo systemctl restart apache2
If you are installing Magento locally, you can add domain.com.
Β Then you have to updateΒ hosts
Β file atΒ /etc/hosts
Β with
127.0.0.1 sonal.magento.com
127.0.0.1 sonal.magento.com
sudo a2ensite sonal.magento.com
.conf
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 Magento_AdminAdobeImsTwoFactorAuth
Hit the URL http://sonal.magento.com in the browser. This is Magento 2 Home page
Admin Login
Your Admin Url βΒ http://sonal.magento.com/admin/Β
Step 7: Install sample data for Magento 2
Now we will deploy sample data for our new Magento 2.4.4 website on localhost. Sample data will fill your website with some products, categories and images so your website will look like this:
To install the sample data, run the below command
php bin/magento sampledata:deploy && php bin/magento indexer:reindex && php bin/magento se:up && php bin/magento se:s:d -f && php bin/magento c:f
Well done! refresh your website and enjoy your new Magento 2.4 installation with sample data
You can watch complete video for this installation of Magento2 on Ubuntu.
Powered by Embed YouTube Video
Wrapping up
I have tried my best to give you the step-by-step tutorial so that it will be helpful for users who are having trouble installing Magento 2.4. If you face any problems during installation process, please drop a comment below (better with image describing your problem). I will be happy to help!
where is phpmyadmin in magento 2.4.5., how to check?
Hello Kotti,
you need to install it separately.
Thanks,
Sonal
YOU ARE GOLD
Hi Sonal,
I am getting
Class “Magento\Framework\App\ResourceConnection\Proxy” does not exist
while running php bin/magento setup:install ….
Can you please help me here.
Thanks
Travel to magento2 directory, and then run below command:
Hi Sonal,
First thank you so much for such the informative blog.
Second, I am facing an issue
““Your requirements could not be resolved to an installable set of packages.
Problem 1
– Root composer.json requires magento/product-community-edition 2.4.5-p2 -> satisfiable by magento/product-community-edition[2.4.5-p2].
– magento/product-community-edition 2.4.5-p2 requires php ~7.4.0||~8.1.0 -> your php version (8.2.3) does not satisfy that requirement.
Problem 2
– magento/magento2-functional-testing-framework[3.7.0, …, 3.12.0] require ext-intl * -> it is missing from your system. Install or enable PHP’s intl extension.
– Root composer.json requires magento/magento2-functional-testing-framework ^3.7 -> satisfiable by magento/magento2-functional-testing-framework[3.7.0, …, 3.12.0].
To enable extensions, verify that they are enabled in your .ini files:
– /etc/php/8.2/cli/php.ini
– /etc/php/8.2/cli/conf.d/10-mysqlnd.ini
– /etc/php/8.2/cli/conf.d/10-opcache.ini
– /etc/php/8.2/cli/conf.d/10-pdo.ini
– /etc/php/8.2/cli/conf.d/15-xml.ini
– /etc/php/8.2/cli/conf.d/20-bz2.ini
– /etc/php/8.2/cli/conf.d/20-calendar.ini
– /etc/php/8.2/cli/conf.d/20-ctype.ini
– /etc/php/8.2/cli/conf.d/20-curl.ini
– /etc/php/8.2/cli/conf.d/20-dom.ini
– /etc/php/8.2/cli/conf.d/20-exif.ini
– /etc/php/8.2/cli/conf.d/20-ffi.ini
– /etc/php/8.2/cli/conf.d/20-fileinfo.ini
– /etc/php/8.2/cli/conf.d/20-ftp.ini
– /etc/php/8.2/cli/conf.d/20-gd.ini
– /etc/php/8.2/cli/conf.d/20-gettext.ini
– /etc/php/8.2/cli/conf.d/20-iconv.ini
– /etc/php/8.2/cli/conf.d/20-mbstring.ini
– /etc/php/8.2/cli/conf.d/20-mcrypt.ini
– /etc/php/8.2/cli/conf.d/20-mysqli.ini
– /etc/php/8.2/cli/conf.d/20-pdo_mysql.ini
– /etc/php/8.2/cli/conf.d/20-phar.ini
– /etc/php/8.2/cli/conf.d/20-posix.ini
– /etc/php/8.2/cli/conf.d/20-readline.ini
– /etc/php/8.2/cli/conf.d/20-shmop.ini
– /etc/php/8.2/cli/conf.d/20-simplexml.ini
– /etc/php/8.2/cli/conf.d/20-sockets.ini
– /etc/php/8.2/cli/conf.d/20-sysvmsg.ini
– /etc/php/8.2/cli/conf.d/20-sysvsem.ini
– /etc/php/8.2/cli/conf.d/20-sysvshm.ini
– /etc/php/8.2/cli/conf.d/20-tokenizer.ini
– /etc/php/8.2/cli/conf.d/20-xmlreader.ini
– /etc/php/8.2/cli/conf.d/20-xmlwriter.ini
– /etc/php/8.2/cli/conf.d/20-xsl.ini
– /etc/php/8.2/cli/conf.d/20-zip.ini
You can also run `php –ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `–ignore-platform-req=ext-intl` to temporarily ignore these required extensions.Your requirements could not be resolved to an installable set of packages.
Problem 1
– Root composer.json requires magento/product-community-edition 2.4.5-p2 -> satisfiable by magento/product-community-edition[2.4.5-p2].
– magento/product-community-edition 2.4.5-p2 requires php ~7.4.0||~8.1.0 -> your php version (8.2.3) does not satisfy that requirement.
Problem 2
– magento/magento2-functional-testing-framework[3.7.0, …, 3.12.0] require ext-intl * -> it is missing from your system. Install or enable PHP’s intl extension.
– Root composer.json requires magento/magento2-functional-testing-framework ^3.7 -> satisfiable by magento/magento2-functional-testing-framework[3.7.0, …, 3.12.0].
To enable extensions, verify that they are enabled in your .ini files:
– /etc/php/8.2/cli/php.ini
– /etc/php/8.2/cli/conf.d/10-mysqlnd.ini
– /etc/php/8.2/cli/conf.d/10-opcache.ini
– /etc/php/8.2/cli/conf.d/10-pdo.ini
– /etc/php/8.2/cli/conf.d/15-xml.ini
– /etc/php/8.2/cli/conf.d/20-bz2.ini
– /etc/php/8.2/cli/conf.d/20-calendar.ini
– /etc/php/8.2/cli/conf.d/20-ctype.ini
– /etc/php/8.2/cli/conf.d/20-curl.ini
– /etc/php/8.2/cli/conf.d/20-dom.ini
– /etc/php/8.2/cli/conf.d/20-exif.ini
– /etc/php/8.2/cli/conf.d/20-ffi.ini
– /etc/php/8.2/cli/conf.d/20-fileinfo.ini
– /etc/php/8.2/cli/conf.d/20-ftp.ini
– /etc/php/8.2/cli/conf.d/20-gd.ini
– /etc/php/8.2/cli/conf.d/20-gettext.ini
– /etc/php/8.2/cli/conf.d/20-iconv.ini
– /etc/php/8.2/cli/conf.d/20-mbstring.ini
– /etc/php/8.2/cli/conf.d/20-mcrypt.ini
– /etc/php/8.2/cli/conf.d/20-mysqli.ini
– /etc/php/8.2/cli/conf.d/20-pdo_mysql.ini
– /etc/php/8.2/cli/conf.d/20-phar.ini
– /etc/php/8.2/cli/conf.d/20-posix.ini
– /etc/php/8.2/cli/conf.d/20-readline.ini
– /etc/php/8.2/cli/conf.d/20-shmop.ini
– /etc/php/8.2/cli/conf.d/20-simplexml.ini
– /etc/php/8.2/cli/conf.d/20-sockets.ini
– /etc/php/8.2/cli/conf.d/20-sysvmsg.ini
– /etc/php/8.2/cli/conf.d/20-sysvsem.ini
– /etc/php/8.2/cli/conf.d/20-sysvshm.ini
– /etc/php/8.2/cli/conf.d/20-tokenizer.ini
– /etc/php/8.2/cli/conf.d/20-xmlreader.ini
– /etc/php/8.2/cli/conf.d/20-xmlwriter.ini
– /etc/php/8.2/cli/conf.d/20-xsl.ini
– /etc/php/8.2/cli/conf.d/20-zip.ini
You can also run `php –ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `–ignore-platform-req=ext-intl` to temporarily ignore these required extensions.Your requirements could not be resolved to an installable set of packages.
Problem 1
– Root composer.json requires magento/product-community-edition 2.4.5-p2 -> satisfiable by magento/product-community-edition[2.4.5-p2].
– magento/product-community-edition 2.4.5-p2 requires php ~7.4.0||~8.1.0 -> your php version (8.2.3) does not satisfy that requirement.
Problem 2
– magento/magento2-functional-testing-framework[3.7.0, …, 3.12.0] require ext-intl * -> it is missing from your system. Install or enable PHP’s intl extension.
– Root composer.json requires magento/magento2-functional-testing-framework ^3.7 -> satisfiable by magento/magento2-functional-testing-framework[3.7.0, …, 3.12.0].
To enable extensions, verify that they are enabled in your .ini files:
– /etc/php/8.2/cli/php.ini
– /etc/php/8.2/cli/conf.d/10-mysqlnd.ini
– /etc/php/8.2/cli/conf.d/10-opcache.ini
– /etc/php/8.2/cli/conf.d/10-pdo.ini
– /etc/php/8.2/cli/conf.d/15-xml.ini
– /etc/php/8.2/cli/conf.d/20-bz2.ini
– /etc/php/8.2/cli/conf.d/20-calendar.ini
– /etc/php/8.2/cli/conf.d/20-ctype.ini
– /etc/php/8.2/cli/conf.d/20-curl.ini
– /etc/php/8.2/cli/conf.d/20-dom.ini
– /etc/php/8.2/cli/conf.d/20-exif.ini
– /etc/php/8.2/cli/conf.d/20-ffi.ini
– /etc/php/8.2/cli/conf.d/20-fileinfo.ini
– /etc/php/8.2/cli/conf.d/20-ftp.ini
– /etc/php/8.2/cli/conf.d/20-gd.ini
– /etc/php/8.2/cli/conf.d/20-gettext.ini
– /etc/php/8.2/cli/conf.d/20-iconv.ini
– /etc/php/8.2/cli/conf.d/20-mbstring.ini
– /etc/php/8.2/cli/conf.d/20-mcrypt.ini
– /etc/php/8.2/cli/conf.d/20-mysqli.ini
– /etc/php/8.2/cli/conf.d/20-pdo_mysql.ini
– /etc/php/8.2/cli/conf.d/20-phar.ini
– /etc/php/8.2/cli/conf.d/20-posix.ini
– /etc/php/8.2/cli/conf.d/20-readline.ini
– /etc/php/8.2/cli/conf.d/20-shmop.ini
– /etc/php/8.2/cli/conf.d/20-simplexml.ini
– /etc/php/8.2/cli/conf.d/20-sockets.ini
– /etc/php/8.2/cli/conf.d/20-sysvmsg.ini
– /etc/php/8.2/cli/conf.d/20-sysvsem.ini
– /etc/php/8.2/cli/conf.d/20-sysvshm.ini
– /etc/php/8.2/cli/conf.d/20-tokenizer.ini
– /etc/php/8.2/cli/conf.d/20-xmlreader.ini
– /etc/php/8.2/cli/conf.d/20-xmlwriter.ini
– /etc/php/8.2/cli/conf.d/20-xsl.ini
– /etc/php/8.2/cli/conf.d/20-zip.ini
You can also run `php –ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `–ignore-platform-req=ext-intl` to temporarily ignore these required extensions.
Your current PHP version is PHP8.2, we need to have 7.4 or 8.1
Thanks Sonal for the response. After making changes I am getting
Class “Magento\Framework\App\ResourceConnection\Proxy” does not exist
Can you please help here.
Travel to magento2 directory, and then run below command:
sudo chmod -R 777 var/ pub/static generated/
You are the best very easy with your help
Best install instructions. Ever. The only times I ran into issues was due to my own typing mistakes, or bash not liking special characters in passwords.
Thank you so much for the time and effort you put into this.
I am seeing Whoops, our bad… (404 Not Found) error. What wrong I have done? Is anybody know how resolve this issue?
Hello David,
To resolve this issue, follow this: – https://www.thecoachsmb.com/site-is-not-accessible/
Great tutorial.
What do I need to do to change the host name for Magento e.g. from example.magento.com to store.mysite.com?
Thanks for your help.
Hello Hajo,
In virtual host file present in /etc/apache2/sites-available/ as given in the article.
Thanks
Would you please be so kind as to explain where I have made a mistake.
/var/www/html/magento/app# vim bootstrap.php
bash: /var/www/html/magento/app#: No such file or directory
Hello Saul Zimmerman,
Check what is the folder name for magento in /var/www/html and one more point, there is no need of modifying bootstrap.php file. do you have any specific reason for doing it.
Thanks
Good afternoon. Could you please help me. Step 6 sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find: βvarβ: No such file or directory
find: βgeneratedβ: No such file or directory
find: βvendorβ: No such file or directory
find: βpub/staticβ: No such file or directory
find: βpub/mediaβ: No such file or directory
find: βapp/etcβ: No such file or directory
Hello Pavlo,
please run this in magento directory
Thanks
I am getting below error when i run php bin/magento setup:install as i added all parameters as per your document
SQLSTATE[HY000] [2002] Connection timed out
In InstallCommand.php line 282:
Parameter validation failed
Can you help me what i am doing wrong
Hello Abu,
Looks like you are facing issue related to db connection. Can you please check db name, db password, db port..
Thanks,
Sonal
Thanks for the instruction. It is absolutely detailed.
While running the installation command on VPS ubuntu server. I am getting this error.
SQLSTATE[HY000] [1045] Access denied for user ‘magento2’@’localhost’ (using password: YES)
In InstallCommand.php line 282:
Parameter validation failed.
Command used:
php bin/magento setup:install –base-url=”http://domainname.com” –db-host=”localhost” –db-name=”magento2″ –db-user=”magento2″ –db-password=”password” –admin-firstname=”admin” –admin-lastname=”Shaikh” –admin-email=”ismat@email.com” –admin-user=”ismat” –admin-password=”Password” –language=”en_US” –currency=USD –timezone=”America/Chicago” –backend-frontname=”admin” –search-engine=”elasticsearch7″ –elasticsearch-host=”localhost” –elasticsearch-port=”9200″
Even if I use the server ip as db host, then it says connection refused. But I am able to connect to the mysql database through command line.
sudo mysql -u magento2 -p
Thanks.
Hello Ismat Ahmed Shaikh,
Thanks for posting your query. The problem looks like of db password. Please make sure you are writing correct password.
Thanks,
Sonal
I have setup magento2, but I am having the following issues:
While adding sample data(php bin/magento sampledata:deploy && php bin/magento indexer:reindex && php bin/magento se:up && php bin/magento se:s:d -f && php bin/magento c:f) I get an error:
Catalog Search index process error during indexation process:
Could not ping search engine: No alive nodes found in your cluster
When I checked elastic search it is not up, I got the following error:
sudo systemctl start elasticsearch.service
Job for elasticsearch.service failed because the control process exited with error code.
See “systemctl status elasticsearch.service” and “journalctl -xe” for details.
Could you please help me
Follow the Elasticsearch installation step properly.
Hello Dear
After installation successful I get this error
404 error not found
Installation in localy Ubuntu
All steep you described in post 100% successful
Magento2.4.4
Apache2
MySQL 8
Php 8.1
Kindly help
Thank you
Hello mam i am facing two factor auth problem how can i fix it please gudide me?
this command isn’t working showing error
php bin/magento module:disable Magento_TwoFactorAuth
What is the error you face while running this command?
Thanks very much for this nice Tutorial.
I am having few problems.
First I can successfully open my home page but cant open admin page it says error 404.
second problem : php/bin magento setup:upgrade shows the following errors.
suneet@ubuntum1:/var/www/html/magento2$ php bin/magento setup:upgrade
Warning: file_put_contents(/var/www/html/magento2/var/cache//mage-tags/mage—f73_CONFIG): Failed to open stream: Permission denied in /var/www/html/magento2/vendor/colinmollenhour/cache-backend-file/File.php on line 691#0 [internal function]: Magento\Framework\App\ErrorHandler->handler()
#1 /var/www/html/magento2/vendor/colinmollenhour/cache-backend-file/File.php(691): file_put_contents()
#2 /var/www/html/magento2/vendor/colinmollenhour/cache-backend-file/File.php(203): Cm_Cache_Backend_File->_updateIdsTags()
#3 /var/www/html/magento2/vendor/magento/zendframework1/library/Zend/Cache/Core.php(390): Cm_Cache_Backend_File->save()
#4 /var/www/html/magento2/vendor/magento/framework/Cache/Core.php(74): Zend_Cache_Core->save()
#5 /var/www/html/magento2/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(63): Magento\Framework\Cache\Core->save()
#6 /var/www/html/magento2/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(75): Magento\Framework\Cache\Frontend\Adapter\Zend->save()
#7 /var/www/html/magento2/vendor/magento/framework/Cache/Frontend/Decorator/TagScope.php(52): Magento\Framework\Cache\Frontend\Decorator\Bare->save()
#8 /var/www/html/magento2/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(75): Magento\Framework\Cache\Frontend\Decorator\TagScope->save()
#9 /var/www/html/magento2/vendor/magento/framework/App/Cache.php(73): Magento\Framework\Cache\Frontend\Decorator\Bare->save()
#10 /var/www/html/magento2/vendor/magento/framework/App/Cache/Proxy.php(81): Magento\Framework\App\Cache->save()
#11 /var/www/html/magento2/vendor/magento/framework/App/ProductMetadata.php(87): Magento\Framework\App\Cache\Proxy->save()
#12 /var/www/html/magento2/vendor/magento/framework/Console/Cli.php(99): Magento\Framework\App\ProductMetadata->getVersion()
#13 /var/www/html/magento2/bin/magento(22): Magento\Framework\Console\Cli->__construct()
#14 {main}
Kindly help
Thanks
Hello Suneet,
Run the command
sudo php/bin magento setup:upgrade
Thanks
cant see the sample data
Hello sam,
Please run below command to install sample data:
php bin/magento sampledata:deploy && php bin/magento indexer:reindex && php bin/magento se:up && php bin/magento se:s:d -f && php bin/magento c:f
Thanks,
Great guide, which works π . Thanks!
Two questions:
1) The installation of sample data does not work for me with the given command. Any hint?
2) Do you have a fitting “Composer” guide to add an extension?
Thanks again. Greetings from Europe
Best install instructions on the net. Working. Thanks.
Thanks Kevin !