0

I am trying to transfer my live site to a local host on my PC, I did the following:

All the website's files are in C:\xampp\htdocs\html. I also imported the database and changed env.php and web/secure/url and web/unsecure/url (to 127.0.0.1/html). The problem is that there are errors in the code where $_SERVER['DOCUMENT_ROOT'] is being used.

I tried changing inside httpd.conf the document root from

DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">

to

DocumentRoot "C:/xampp/htdocs/html"
<Directory "C:/xampp/htdocs/html">

And the result was that my site was showing, but all pages are 404.

Am I missing something? maybe some DB configuration or Magento's file for local environment?

thanks.

Abhishek Tripathi
2,9152 gold badges21 silver badges38 bronze badges
asked Oct 15, 2017 at 22:16
3
  • Make sure mod_rewrite module is installed in your local server. You can check using phpinfo() fucntion. Commented Oct 16, 2017 at 5:30
  • @Hezided Did you tried to install Magento on your local server is it compatible with your local configuration? Commented Oct 16, 2017 at 5:32
  • @IrfanMomin yes it's uncommented in httpd.conf.@ABHISHEK TRIPATHI not sure I understand your question... Commented Oct 16, 2017 at 16:08

2 Answers 2

0

If you have changed your DocumentRoot to "C:/xampp/htdocs/html", then your web/unsecure/url entry will be "http://127.0.0.1/ " .

Change this entry in database and clear the cache. It should work for you.

answered Oct 16, 2017 at 5:55
7
  • I still get "page not found" everywhere... Commented Oct 16, 2017 at 7:03
  • can you please share the sceenshot of the browser page including the url Commented Oct 16, 2017 at 7:12
  • imgur.com/a/0tBzc the marked string means "page not found" Commented Oct 16, 2017 at 14:59
  • If you'll check the url in browser, it is 127.0.0.1/html it should be 127.0.0.1 then it will load the homepage. Commented Oct 16, 2017 at 17:07
  • yes it's true, but then if I click any link in my site the 'html' is added, for example: 127.0.0.1/html/sack-bags.html Commented Oct 16, 2017 at 17:20
0

eventually what worked for me was to move all the files to separate folder (C:/myFolder), and change the DocumentRoot to there... also values of:

web/unsecure/base_url
web/secure/base_url
web/unsecure/base_link_url
web/secure/base_link_url

is http://127.0.0.1:8080/

answered Oct 19, 2017 at 7:46

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.