2

I installed Magento 2.3 successfully but when type http://localhost/Magento2/, I get a blank page like this:enter image description here

and these are the errors found in the console: enter image description here

The same issue is also faced on the admin panel. My current version of PHP is 7.2.14.

3 Answers3

1

You cannot use http://localhost/ as domain name with Magento 2, you should at least use http://localhost.com/.

  1. Change your vHost in Docker/XAMP/MAMP/WAMP... to match your new domain name, for instance http://localhost.com/;

  2. Edit your hosts file with sudo permissions :

    • Debian / MacOS: /etc/hosts

    • Windows: C:\Windows\System32\drivers\etc\hosts

  3. At the bottom of the file, add the following: 127.0.0.1 localhost.com

  4. Go to your Magento db and run the following query :

UPDATE `core_config_data` SET `value`='http://localhost.com/' WHERE `value`='http://localhost/';
  1. Finally, with command line :
cd /YOUR/PROJECT/PATH
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
  1. Go to http://localhost.com/ (or http://localhost.com/Magento2/, according to your configuration), and check if everything works.
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Antoine Martin
  • 618
  • 8
  • 21
  • What if you only have cPanel access and can't run the shell commands? – XCS Feb 12 '19 at 21:17
  • @Cristy, in that case use the trick described here [Magento without command line](https://magento.stackexchange.com/questions/125064/how-to-install-module-magento-2-dont-need-run-command-line-bin-magento-setupup/125090#125090) – Antoine Martin Feb 13 '19 at 07:02
  • Tried that, unfortunately my shared hosting also has system calls disabled, so it should be a pure PHP solution. LE: Just saw the second option in the answer, trying it now. – XCS Feb 13 '19 at 20:07
  • Was able to run the commands as explained there, but still no static files, css missing. – XCS Feb 13 '19 at 20:24
  • I am actually not sure running the commands as explained there does anything, it doesn't seem to work though, but it takes time to execute them. – XCS Feb 13 '19 at 20:30
0

I've same problem and solved by these commands:

php bin/magento setup:upgrade

php bin/magento setup:di:compile

php bin/magento setup:static-content:deploy

0
  1. In file /etc/apache2/apache2.conf Navigate <Directory /var/www/>Change "AllowOverride None" to "AllowOverride All"
  2. Add this at last in env.php located at <MagentoRootDirectory/app/etc>

'system' => [

       'default' => [

           'web' => [

               'unsecure' => [

                   'base_media_url' => '{{secure_base_url}}pub/media/',

                   'base_static_url' => '{{secure_base_url}}pub/static/'

               ],

               'secure' => [

                   'base_media_url' => '{{secure_base_url}}pub/media/',

                   'base_static_url' => '{{secure_base_url}}pub/static/'

               ]

           ]

       ]

   ]
  1. In etc/di.xml,Search Under that Modify this Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy
  2. Add this in db INSERT INTO core_config_data (path, value) VALUES ('dev/static/sign', 0) ON DUPLICATE KEY UPDATE value = 0;
  3. Add this in db UPDATE core_config_data SET value = '0' WHERE core_config_data.path LIKE '%web/seo/use_rewrites%'; Run this command, sudo a2enmod rewrite
UtSaV_GaRg
  • 1
  • 1
  • 1
  • 3