Hello
I am beginner in magento 2
I followed all installation instructions
make all checking
but failed to verify site when try to excute http://localhost/magento2/pub/
I got the resulting
I tried everything found on blogs
nothing seems works
Could you help me
Solved! Go to Solution.
In fact, I change in the install command the "base-url" from "http://localhost/magento2" to " http://localhost/magento2/pub" and it works !
Does someone can explain why?
I guess the /pub is really the root directory of magento2
bin/magento setup:install \ --base-url=http://localhost/magento2/pub \ --db-host=localhost \ --db-name=magento \ --db-user=magento \ --db-password=magento \ --admin-firstname=jl \ --admin-lastname=xxxxxx\ --admin-email=xxxxxx@gmail.com \ --admin-user=admin \ --admin-password=adminxxxx\ --language=fr_FR \ --currency=EUR \
You can implement the below solution:
Steps to Install Magento 2.4.2 on Localhost
1. Run the below command after downloading Magento 2.4.2.
php bin/magento setup:install --base-url="http://127.0.0.1/mag242sample/" --db-host="localhost" --db-name="mag242sample" --db-user="root" --admin-firstname="admin" --admin-lastname="admin" --admin-email="admin@admin.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="INR" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin"
Common Magento 2.4.2 Installation Issues and their solution:
Admin Error 404:
Here’s a quick fix for that issue:
1. Copy the index.php and .htaccess files from the pub folder and paste into the root directory.
2. Both files are in the pub folder when we download the setup for security purposes, but we’ve to follow this step while installing in the local.
3. Replace the below line in the index.php file that we’d paste in the root directory.
require __DIR__ . '/../app/bootstrap.php';
with
require __DIR__ . '/app/bootstrap.php';
4. Insert the below four rows in the core_config_data table.
Path Value
web/secure/base_static_url http://localhost/m242/pub/static/
web/unsecure/base_static_url http://localhost/m242/pub/static/
web/secure/base_media_url http://localhost/m242/pub/media/
web/unsecure/base_media_url http://localhost/m242/pub/media/
5. Pass the below command
php bin/magento cache:flush
you just need to update the apache2.conf file.
On Ubuntu 16.04
Open and edit the file /etc/apache2/apache2.conf
Navigate to the place in the apache2.conf file <Directory /var/www/>
Change "AllowOverride None" to "AllowOverride All"
Save the file
Restart apache2 -> sudo service apache2 restart
In fact, I change in the install command the "base-url" from "http://localhost/magento2" to " http://localhost/magento2/pub" and it works !
Does someone can explain why?
I guess the /pub is really the root directory of magento2
bin/magento setup:install \ --base-url=http://localhost/magento2/pub \ --db-host=localhost \ --db-name=magento \ --db-user=magento \ --db-password=magento \ --admin-firstname=jl \ --admin-lastname=xxxxxx\ --admin-email=xxxxxx@gmail.com \ --admin-user=admin \ --admin-password=adminxxxx\ --language=fr_FR \ --currency=EUR \