<legend id='OXB81'><style id='OXB81'><dir id='OXB81'><q id='OXB81'></q></dir></style></legend>

<i id='OXB81'><tr id='OXB81'><dt id='OXB81'><q id='OXB81'><span id='OXB81'><b id='OXB81'><form id='OXB81'><ins id='OXB81'></ins><ul id='OXB81'></ul><sub id='OXB81'></sub></form><legend id='OXB81'></legend><bdo id='OXB81'><pre id='OXB81'><center id='OXB81'></center></pre></bdo></b><th id='OXB81'></th></span></q></dt></tr></i><div id='OXB81'><tfoot id='OXB81'></tfoot><dl id='OXB81'><fieldset id='OXB81'></fieldset></dl></div>

        <bdo id='OXB81'></bdo><ul id='OXB81'></ul>

      <small id='OXB81'></small><noframes id='OXB81'>

      1. <tfoot id='OXB81'></tfoot>

        如何在 localhost 上运行文件?

        时间:2024-04-12
            <tbody id='EKguz'></tbody>
          <tfoot id='EKguz'></tfoot>
          <legend id='EKguz'><style id='EKguz'><dir id='EKguz'><q id='EKguz'></q></dir></style></legend>
          <i id='EKguz'><tr id='EKguz'><dt id='EKguz'><q id='EKguz'><span id='EKguz'><b id='EKguz'><form id='EKguz'><ins id='EKguz'></ins><ul id='EKguz'></ul><sub id='EKguz'></sub></form><legend id='EKguz'></legend><bdo id='EKguz'><pre id='EKguz'><center id='EKguz'></center></pre></bdo></b><th id='EKguz'></th></span></q></dt></tr></i><div id='EKguz'><tfoot id='EKguz'></tfoot><dl id='EKguz'><fieldset id='EKguz'></fieldset></dl></div>

            <bdo id='EKguz'></bdo><ul id='EKguz'></ul>

                <small id='EKguz'></small><noframes id='EKguz'>

                  本文介绍了如何在 localhost 上运行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何在 localhost 上实际运行文件?我知道它正在运行,但是如何在其上运行文件,以及如何验证该文件实际上是在 localhost 上运行的?

                  How do I actually run a file on localhost? I know it is working, but how do I run a file on it, and how do I verify that the file is in fact running on localhost?

                  这里是服务器新手,还有其他问题(我有运行 Apache 2.2 的 xampp):从您的回复看来,我必须在浏览器中输入路径才能在本地主机上打开文件.所以,如果我想将文件放在子目录中,我必须输入包括目录在内的完整路径?

                  Server newbie here, additional questions (I have xampp running Apache 2.2): From your responses it sounds like I have to type in the path in the browser in order to open the file on the localhost. So, if I want to have the file in a subdirectory, I would have to type the full path including the directory?

                  有没有办法在我处理 html 时让浏览器指向本地主机,而不必一直输入路径?

                  Is there a way to have the browser point to the localhost while I am working on my html, instead of having to type in the path all the time?

                  我在 Dreamweaver CS3 中工作,并且想使用 include 命令(SSI 或 PHP),但不必一直将我的文件放在 HostGator 上以查看它们是否正常工作.

                  I am working in Dreamweaver CS3, and want to use include commands (either SSI or PHP), but not have to keep putting my files up on HostGator in order to see if they are working.

                  最好的方法是什么(请具体说明,我一无所知).如果哪里有详细的教程,非常感谢链接.

                  What is the best way to do this (please be specific, I know nothing). If there is a detailed tutorial anywhere, really appreciate a link.

                  谢谢

                  推荐答案

                  好的,感谢您提供更具体的信息,人们现在可以删除他们的反对票...

                  Ok, thanks for the more specific info, ppl may remove their downvotes now...

                  您提出的建议是很常见的事情!您想在本地运行您的 Web 应用程序,而不是将其上传到您的主机.这完全没问题,这就是您的 Apache 的用途.您的 Apache 是一个 Web 服务器,这意味着它的主要目的是提供 HTML、PHP、ASP 等文件.有些喜欢 PHP;它首先发送到解释器,然后将呈现的文件发送到浏览器.总而言之:它只是为您的浏览器(客户端)提供页面.

                  What you are proposing is a very common thing to do! You want to run your web application locally without uploading it to your host yet. That's totally fine and that's what your Apache is there for. Your Apache is a web server meaning its main purpose is to serve HTML, PHP, ASP, etc. files. Some like PHP; it first sends to the interpreter and then sends the rendered file to the browser. All in all: it's just serving pages to your browser (the client).

                  您的网络服务器有一个根目录,即 wwwroot (IIS) 或 htdocs(apache、xampp)或其他类似 public_html、www 或 html 等的目录.这取决于您的操作系统和网络服务器.

                  Your web server has a root directory which is wwwroot (IIS) or htdocs (apache, xampp) or something else like public_html, www or html, etc. It depends on your OS and web server.

                  现在,如果您在浏览器中键入 http://localhost,您的浏览器将被定向到该 webroot 并且服务器将提供任何 index.htmlindex.php 等,它可以在那里找到(按可定制的顺序).

                  Now if you type http://localhost into your browser, your browser will be directed to this webroot and the server will serve any index.html, index.php, etc. it can find there (in a customizable order).

                  如果您有一个名为mytutorial"的项目,您可以输入 http://localhost/mytutorial,服务器会显示您的教程的索引文件等.如果您查看这个教程文件夹的绝对路径,那么它只是你的 webroot 的一个子文件夹,它本身位于你的硬盘驱动器的某个地方,但这对你的本地主机无关紧要.

                  If you have a project called "mytutorial" you can enter http://localhost/mytutorial and the server will show you the index-file of your tutorial, etc. If you look at the absolute path of this tutorial folder then it's just a subfolder of your webroot, which is itself located somewhere on your harddrive, but that doesn't matter for your localhost.

                  所以相对路径是

                  http://localhost/mytutorial
                  

                  而绝对路径可能是

                  c:/webservices/apache/www
                  

                  c:/xampp/htdocs
                  

                  如果您使用 Dreamweaver,则可以通过在项目设置中将本地服务器设置为测试服务器来简化测试过程.试试看!这简单.完成后,您只需按下任何文件的浏览器图标,它就会在 localhost 上打开.

                  If you're working with Dreamweaver you can simplify the testing process by setting up your local server as a testing server in your project settings. Try it! It's easy. Once it's done, you can just press the browser icon with any of your files and it will open on localhost.

                  这篇关于如何在 localhost 上运行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 XAMPP 托管多个本地站点 下一篇:如何在 Windows 上使用作曲家?

                  相关文章

                • <tfoot id='DGdT9'></tfoot>
                • <i id='DGdT9'><tr id='DGdT9'><dt id='DGdT9'><q id='DGdT9'><span id='DGdT9'><b id='DGdT9'><form id='DGdT9'><ins id='DGdT9'></ins><ul id='DGdT9'></ul><sub id='DGdT9'></sub></form><legend id='DGdT9'></legend><bdo id='DGdT9'><pre id='DGdT9'><center id='DGdT9'></center></pre></bdo></b><th id='DGdT9'></th></span></q></dt></tr></i><div id='DGdT9'><tfoot id='DGdT9'></tfoot><dl id='DGdT9'><fieldset id='DGdT9'></fieldset></dl></div>

                    1. <legend id='DGdT9'><style id='DGdT9'><dir id='DGdT9'><q id='DGdT9'></q></dir></style></legend>

                        <bdo id='DGdT9'></bdo><ul id='DGdT9'></ul>

                      <small id='DGdT9'></small><noframes id='DGdT9'>