Problems with displaying a php-site locally with XAMPP-package. Site works fine on remote server

十年热恋 提交于 2020-01-22 03:15:07

问题


My first ever post on stackoverflow.com! A great site, and I hope my post will contribute to the benefit of others.

The situation: I have been entrusted to renovate a really small, existing, php-driven web site.

So, I started to set up my environment:

  • Dreamweaver was installed.
  • I FTP'd the files to my computer from the remote server.
  • I choose Apache and MySQL via the XAMPP package to set up a local host on my computer (PC, Windows XP), installed XAMPP and set the passwords that are left out by default.
  • I made sure that both Apache and MySQL was up and running.
  • I set the parameters for the local info, remote info and testing server in Dreamweaver, (this took some time).

All's well so far.

But the site would not work properly when previewed locally in a browser. The live version ran just fine.

The problem: The first page of the site would launch with no connection to the css stylesheet or the images folder and when trying the generated links, they would hit the XAMPP redirect in the root folder and the XAMPP orange page would display.

So, how to fix this?

Again, thanx for a great site! /Vaquera


回答1:


The solution ...was to edit the DocumentRoot setting in the xampp/apache/conf/httpd.conf file.

The thing was that I had placed the folder where the dynamic contents of my test site was as a subfolder to XAMPPs default webroot folder htdocs: htdocs/MySampleSite

When I edited the DocumentRoot setting in the xampp/apache/conf/httpd.conf from the default folder DocumentRoot "C:/xampp/htdocs" to the actual folder DocumentRoot "C:/xampp/htdocs/MySampleSite" all the problems resolved themselves.

Do remember that you need to change this on two locations in httpd.conf! Apart from the above mentioned, you also have to change the default to

Well, in hindsight, I guess it's rather trivial, but it took some time in finding the right place, so I hope this might help others.

Again, thanx for a great site! Vaquera



来源:https://stackoverflow.com/questions/11450669/problems-with-displaying-a-php-site-locally-with-xampp-package-site-works-fine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!