Laravel安装程序无法打开流 [英] Laravel setup failed to open stream
问题描述
我正在尝试安装laravel,但事实证明,这是正确的选择!我已经从github克隆了它,还使用了作曲家来克隆laravel,并且我已经使这两种技术都起作用了,这很好,因为它是我真正想学习的东西.比我想象的要简单.
I'm trying to setup laravel but its proving to be a right mere! I've cloned it from github and also used composer to clone laravel and I've got both of these techniques working which is good because its something I really wanted to learn. Simpler than I thought.
但是,当我尝试导航到名为iProject的laravel目录时,我在浏览器localhost/iProject中键入时,会得到目录列表,该目录不是我期望的,我希望至少可以打到你好. php页面.
However when I try to navigate to my laravel directory which is called iProject so I type into my browser localhost/iProject I get a list of directories which is not what I expected, I expected to be directed to at least the hello.php page.
我已经厌倦了Net-tuts教程中描述的另一种技术,该技术是设置侦听端口,然后我要通过localhost:8888,但是当使用此技术时,会出现以下错误消息:
I've tired another technique as described in a Net-tuts tutorial which is setting up a listening port and there I am then going through localhost:8888, but when using this technique the following error message appears:
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'public/' include_path='.;C:\xampp\php\PEAR') in Unknown on line 0
设置虚拟主机(根据收到的响应)
设置虚拟主机后,我将重定向到xampp,URL转到iproject.dev/xampp
Setting up Virtual Host (as per responses received)
When I setup the virtual host I am redirected to xampp the url goes to iproject.dev/xampp
我已经这样设置了虚拟主机:
I've setup a virtual host as so:
C:\ Windows \ System32 \ drivers \ etc \ hosts
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 iproject.dev
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/iProject/public"
ServerName iproject.dev
ServerAlias iproject.dev
ErrorLog "logs/iProject.liog"
CustomLog "logs/custom.iProject.log" combined
<Directory "C:/xampp/htdocs/iProject/public">
AllowOverride All
Order Allow,Deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
推荐答案
您可以在httpd-vhosts.conf
文件中简单使用(我的所有项目都具有相同的设置)
You can simply use (I've same setup for all of my projects) in httpd-vhosts.conf
file
<VirtualHost iproject.dev>
DocumentRoot "C:/xampp/htdocs/iProject/public"
ServerName iproject.dev
</VirtualHost>
此外,在您的C:\Windows\System32\drivers\etc\hosts
文件中添加以下行
Also, add the following line in you C:\Windows\System32\drivers\etc\hosts
file
127.0.0.2 iproject.dev # 127.0.0.2 could be 127.0.0.3 or ...4/...5
例如,这是我的win-7
中的hosts
文件的一部分
For example, this is a part of my hosts
file in win-7
127.0.0.1 localhost
127.0.0.1 127.0.0.1
127.0.0.2 alimsearch.dev # alimsearch.co.uk
127.0.0.3 laravel4.dev
# ...
还有我的httpd-vhosts.conf
文件的一部分
<VirtualHost alimsearch.dev>
DocumentRoot "D:/xampp/htdocs/alimsearch/public"
ServerName alimsearch.dev
</VirtualHost>
<VirtualHost laravel4.dev>
DocumentRoot "D:/xampp/htdocs/laravel4/public"
ServerName laravel4.dev
</VirtualHost>
这篇关于Laravel安装程序无法打开流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!