skip to Main Content

I am facing this issue when i was trying to open (localhost/wordpress)
this error is showing

3

Answers


  1. You need to put wordpress in the correct folder so apache can read the php files and serve the content to clients connecting to the url. Moreover please consider using an FQDN resolver by your interlan dns server or forcing the resolution modifying the ‘hosts’ file.

    Login or Signup to reply.
  2. I was also facing the same issue while working on Magento 2.4.2. Following workaround worked for me.

    Step 1: Set the root directory to ‘magento2/pub’

    • go to file C:xamppapacheconfextrahttpd-vhosts.conf

    • Paste below code at the bottom of the file.

      <VirtualHost *:80>
      DocumentRoot "C:/xampp/htdocs/magento24/pub"
      ServerName yourname.magento.com

      Replace with your project name.

    Step 2: Update the local host domain

    • goto file C:WindowsSystem32driversetchosts

    • Paste below code at the bottom of file.

      127.0.0.1 yourname.magento.com

    Step 3: Update base URL in database.

    • goto magento db and run the below sql query.
      UPDATE core_config_data SET value=’http://yourname.magento.com/’ WHERE path=’web/unsecure/base_url’;

    Step 4: Update env.php file

    • goto file: app/etc/env.php

    • Paste below code at the bottom of the file.

      ‘directories’ => [
      ‘document_root_is_pub’ => true
      ]

    Step 5: Enable developer mode

    • run below commands on cmd from your project directory.

      php bin/magento deploy:mode:set developer
      php bin/magento cache:flush

    Login or Signup to reply.
  3. Also check if you have created several files on different directories as it may cause this error

    make sure it’s only on the C:/xampp/htdocs/(create a new folder by the name login)/(save your file here)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search