【问题标题】:Laravel ConfigurationLaravel 配置
【发布时间】:2018-10-12 01:36:21
【问题描述】:

我一直在尝试配置 Laravel,但似乎出现了某种错误:“找不到 IP 地址。”

这是我在 httpd-vhost.conf 中的配置 Configuration on httpd-vhost

这就是我放入主机的内容 enter image description here

我尝试在 apache 中通过 httpd.exe -t 重新启动并检查我的语法,但似乎没问题

【问题讨论】:

  • 你试过宅基地吗?
  • 还没试过。我会调查的。但是我所做的是否有错误?
  • 老实说,我将不得不把它留给其他人。我专业地使用 Laravel,我们都使用 Homestead,因为它模仿了专用服务器的设置,而我们无需花费时间来设置它。但我不怀疑它值得学习——我知道我至少做过一次。

标签: laravel configuration virtualhost web-development-server


【解决方案1】:

你可以试试这个。

在你的 httpd-vhost.conf 文件中写下这个,如果你想要 reviewer 的虚拟主机,那么试试这个,

<VirtualHost *:80>
  ServerName reviewer.test
  ServerAlias reviewer.test
  DocumentRoot "C:/xampp/htdocs/reviewer/public"
  DirectoryIndex index.php
  <Directory "C:/xampp/htdocs/reviewer/public">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

在你的 hosts 文件中写下这个,

127.0.0.1       reviewer.test

然后重新启动您的所有 xampp 服务器服务。

您的文件有问题

你还没有删除评论(#这个符号代表它是评论。)

这是您的文件配置。

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   127.0.0.1       reviewer.dev

您必须删除 # 这个符号,并将 dev 替换为 test 。更多知识来自this link.

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
    127.0.0.1       reviewer.test

我希望这些东西对你有帮助。

【讨论】:

  • 太棒了 :) 您可以接受答案并点赞作为感谢,这将是我在 stackoverflow 中的奖励。
  • @SofiaMallari 请接受我的答案(标记为答案),因为您发现它很有帮助。其他堆栈用户会知道这个答案对您的问题是正确的,无需为您找到其他答案。 Check this tour
猜你喜欢
  • 2015-07-21
  • 2017-07-25
  • 1970-01-01
  • 2021-02-24
  • 2020-04-22
  • 2017-02-11
  • 2016-09-24
  • 1970-01-01
  • 2019-04-16
相关资源
最近更新 更多