我如何使用XAMPP测试一个网站? [英] How do I test a website using XAMPP?

查看:243
本文介绍了我如何使用XAMPP测试一个网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我对如何做到这一点很困惑一个相当普遍的查询。我想用这是我为了测试网站我建立,将使用PHP和MySQL的下载为XAMPP的一部分Apache服务器。一般的问题是:我如何做到这一点。

This is a fairly general query as I'm very confused about how to do this. I want to use the apache server which I have downloaded as part of XAMPP in order to test the website I am building, which will use php and mysql. The general question is: how do I do this?

据我了解,文件进入C:\\ XAMPP \\ htdocs中,然后可以通过本地主机进行访问。什么混淆我虽然是XAMPP的管理东东也设在这里 - 所以,举例来说,我不能不失访问phpMyAdmin等替换index.php文件。我必须对这个范围内的网站上创建一个新的文件夹?

As far as I understand it, the files go into C:\xampp\htdocs, which can then be accessed via localhost. What confuses me though is that the XAMPP admin stuff is also located here - so, for instance, I can't replace the file index.php without losing access to phpMyAdmin and so on. Do I have to create a new folder for the website within this?

我试着设置使用我在网上找到指令的虚拟主机。我把它添加到Windows主机文件和XAMPP的主机配置文件作为这里执导,例如。有了这个做了Apache服务将无法启动,给了我非常类似的错误日志,<一个href=\"http://stackoverflow.com/questions/16644064/xampp-session-cache-is-not-configured-hint-sslsessioncache\">this 之一。我跟着这个问题的答案的指示,它仍然没有工作。因为我已经删除并重新安装它,它重新工作正常,但没有虚拟主机设置。

I tried setting up a virtual host using instructions I found online. I added it to the windows host file and to the xampp hosts config file as directed here, for instance. Having done this the Apache service would not start and gave me an error log very similar to this one. I followed the instructions given in the answer to that, and it still did not work. I have since removed and reinstalled it and it is working ok again, but without the virtual hosts set up.

最后,我想用HTMLPad打造的网站,因为我真的很喜欢它的实时preVIEW功能。但是,设置此,再次需要与服务器进行连接。它给人的指令是:

Finally, I want to use HTMLPad to build the website because I really like its real time preview feature. However, to set this up, it again needs to be connected with the server. The instructions it gives are:

在深入教程:我如何preVIEW PHP文件

In-depth Tutorial: How do I preview PHP files?

要能够preVIEW PHP文件在本地没有上传到网络,你
  需要在您的计算机上安装一个Web服务器和它必须是
  配置为支持PHP文件。请参阅PHP和web服务器
  手册,了解有关安装Web服务器支持PHP的更多信息。

To be able to preview PHP files locally without uploading to web, you need to have a web server installed on your computer and it must be configured to support PHP files. Please refer to PHP and web server manuals for more info on installing web server with PHP support.

我们建议使用从apache.org

We recommend to use the free Apache web server from apache.org

第1步 - 什么是你的文档根目录?搞清楚什么是你的本地网络
  服务器文档根目录文件夹。文档根目录文件夹存储网页
  通过您的Web服务器的URL提供的文件。请参考您的web
  服务器手动获取更多信息。

Step 1 - What is your document root? Find out what is your local web server document root folder. The document root folder stores web page files available via your web server URL. Please refer to your web server manual for more info.

第2步 - 什么是您的Web服务器地址是什么?搞清楚什么是你的本地
  Web服务器的URL,它通常是的http://本地主机/

Step 2 - What is your web server address? Find out what is your local web server URL, usually it is http://localhost/

第3步 - 确保您的网络服务器的工作原理验证您的Web服务器
  真正起作用的PHP文件。要做到这一点,一个PHP文件保存到你的网页
  文档根目录,并尝试通过Web浏览器来打开它。例如,如果你的
  Web文档根目录为c:\\ htdocs中\\,将文件另存为c:\\ htdocs中\\的index.php
  并试图通过URL来打开它 HTTP://localhost/index.php

Step 3 - Make sure your web server works Verify that your web server really works with PHP files. To do this, save a PHP file to your web document root and try to open it via web browser. For example, if your web document root is c:\htdocs\, save your file as c:\htdocs\index.php and try to open it via URL http://localhost/index.php

如果您的Web服务器的工作原理,你现在就可以配置内部
  preVIEW。

If your web server works, you are now ready to configure internal preview.

步骤4 - 配置内部preVIEW现在,你必须告诉编辑器
  软件如何使用你的Web服务器,以显示PHP文件preVIEW。

Step 4 – Configure internal preview Now you must tell the editor software how to use your web server to display the PHP file preview.

在选项菜单上,单击preferences;在preferences窗口中,单击
  preVIEW文件夹;单击映射,然后单击添加;输入您的文档
  根文件夹和对应的网络地址,在上述的例子
  你需要输入C:\\ htdocs中\\和的http://本地主机/

On the Options menu, click Preferences; In Preferences window, click Preview folder; Click Mappings, then click Add; Enter your document root folder and the corresponding web address, in the above example you would enter c:\htdocs\ and http://localhost/

此外,在上述所有的情况下,我不能肯定我明白这一点。 presumably此链接到所有的PHP,MySQL等文件原来的htdocs文件夹内?但它无论身在何处,我工作的文件保存,例如?

Again, in the context of all the above, I'm not quite sure I understand this. Presumably this links to all the php, mysql etc files within the original htdocs folder? But does it matter where the files I'm working on are saved, for example?

基本上,我只是有点困惑,和任何帮助将非常AP preciated!

Basically, I'm just a bit confused, and any help would be very much appreciated!

推荐答案

在线服务器上的网页居住在一个的位置的这看起来有点像这样:的http:// www.somerandomsite.com/index.php

The webpages on an online server reside in a location which looks somewhat like this: http://www.somerandomsite.com/index.php

由于XAMPP是的离线的,它建立的本地服务器,其地址是这个样子
的http://本地主机/

Since xampp is Offline, it sets up a local server whose address is like this http://localhost/

基本上,XAMPP设置一个服务器(Apache等)在您的系统。和所有的文件,如index.php的,somethingelse.php等,驻留在 XAMPP \\ htdocs中\\ 文件夹中。

Basically, xampp sets up a server (apache and others) in your system. And all the files such as index.php, somethingelse.php, etc., reside in the xampp\htdocs\ folder.

浏览器所处的服务器在本地主机,并通过在那里提供上述文件夹中的所有资源进行搜索。

The browser locates the server in localhost and will search through the above folder for any resources available in there.

所以,创建内部的任何数量的文件夹XAMPP \\ htdocs中\\每个文件夹从而形成的网站的(为您打造它)。

So create any number of folders inside the "xampp\htdocs\" each folder thus forming a website (as you build it).

有时,Apache将不会开始。这是由于与某些应用程序的端口碰撞。他们中的一些常用的我碰到的是Skype的。看到它完全杀死,并重新启动Apache

Sometimes apache won't even start. This is due to the clashing of ports with some applications. Some of them I commonly encounter is Skype. See to that it is killed completely and restart apache

这篇关于我如何使用XAMPP测试一个网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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