【问题标题】:localhost vs hostname, the hostname is not working properlylocalhost vs 主机名,主机名无法正常工作
【发布时间】:2017-02-16 19:24:30
【问题描述】:

我有一个可以工作(生产)的 cakePHP 应用程序(旧 1.3x)。现在我正在尝试在我的 win7 上安装 wamp - 用于开发目的。
我正在使用“bitnami”的 wamp。

为此 - 我更改了 hosts 文件添加了 127.0.0.1 mydomain 行。
我还更改了httpd.conf 文件,添加了以下内容:

NameVirtualHost *:80
<VirtualHost *:80>
  ServerName mydomain
  DocumentRoot "D:\wamp/apache2/htdocs/foldername"
  DirectoryIndex index.php index.html
</VirtualHost>

完成了。 访问http://localhost/folder 有效(一些内部链接问题,但这是意料之中的——因为它有一些相对网址)

访问http://mydomain 返回 200/ok 响应,但它是空的。

我做错了什么?

【问题讨论】:

  • WSOD(白屏死机)。您在运行“index.php”时遇到了潜在问题 查看错误日志以找出它们为什么给您白页。如果您不相信我,添加一个非 php 文件,例如 give 或 hello.txt,其中包含“hello world”,您会看到它加载得非常好。
  • 真丢脸...这是 index.php 文件中的一个注释 php 行(唯一一个)。

标签: apache localhost cakephp-1.3 httpd.conf


【解决方案1】:

似乎一切都很好。我只是评论了require 'webroot' . DIRECTORY_SEPARATOR . 'index.php'; 行... 它是作为临时测试进行的,当我 ctrl+z 更改时,我没有保存它。

它是固定的。 谢谢

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-26
    • 1970-01-01
    • 2013-02-10
    • 1970-01-01
    • 1970-01-01
    • 2013-10-25
    • 2017-11-12
    • 2016-02-23
    相关资源
    最近更新 更多