Abdullah Shahid
Abdullah Shahid

Reputation: 7

Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/7.4.16 Server at localhost Port 80

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

Upvotes: -1

Views: 156789

Answers (3)

Emmanuel
Emmanuel

Reputation: 1

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)

Upvotes: 0

Kalpesh Dixit
Kalpesh Dixit

Reputation: 41

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:\xampp\apache\conf\extra\httpd-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:\Windows\System32\drivers\etc\hosts

  • 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

Upvotes: 1

Inc0
Inc0

Reputation: 809

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.

Upvotes: 0

Related Questions