使用XAMPP软件包在本地显示php站点时出现问题。站点在远程服务器上工作正常 [英] Problems with displaying a php-site locally with XAMPP-package. Site works fine on remote server

查看:91
本文介绍了使用XAMPP软件包在本地显示php站点时出现问题。站点在远程服务器上工作正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在stackoverflow.com上的第一个帖子!一个很棒的网站,希望我的帖子对其他人有所帮助。

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

情况:
我已受托翻新 really 小型,现有的php驱动的网站。

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 。

  • 我将文件从远程服务器FTP到我的计算机上。

  • 我通过XAMPP软件包选择Apache和MySQL来设置本地我的计算机(PC,Windows XP)上的
    主机安装了XAMPP并设置了默认情况下未使用的
    密码。

  • 我确保Apache和MySQL已启动并运行。

  • 我设置了本地信息,远程信息的参数,并在Dreamweaver中测试了
    服务器,(花了一些时间)。

  • 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).

到目前为止一切正常。

但是当在本地预览时,该网站无法正常工作浏览器。实时版本运行得很好。

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

问题:
该网站的第一页将启动,而没有与CSS的连接样式表或图片文件夹,并尝试生成链接时,它们将在根文件夹中命中XAMPP重定向,并显示XAMPP橙色页面。

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?

再说一次,thanx就是一个不错的网站!
/ Vaquera

Again, thanx for a great site! /Vaquera

推荐答案

解决方案
...正在编辑

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

问题是,我将文件夹放置在测试站点的动态内容所在的目录中。 XAMPP的默认Webroot文件夹htdocs的子文件夹:htdocs / MySampleSite

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

当我从默认文件夹DocumentRoot中的xampp / apache / conf / httpd.conf中编辑DocumentRoot设置时, C:/ xampp / htdocs到实际文件夹DocumentRoot C:/ xampp / 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.

请记住,您需要在httpd.conf中的两个位置进行更改!除了上面提到的以外,您还必须将默认值更改为

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.

同样,thanx是一个不错的网站!
Vaquera

Again, thanx for a great site! Vaquera

这篇关于使用XAMPP软件包在本地显示php站点时出现问题。站点在远程服务器上工作正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆