简体   繁体   English

laravel 4在Windows XAMPP上不起作用

[英]laravel 4 does not work on Windows XAMPP

On Windows 7 cmd I have run composer create-project laravel/laravel blog --prefer-dist from `C:\\xampp\\htdocs\\lara. 在Windows 7 cmd上,我从`C:\\ xampp \\ htdocs \\ lara运行了composer create-project laravel/laravel blog --prefer-dist Everything is downloaded and installed fine. 一切都下载并安装得很好。

However, when I try to access http://localhost/lara/blog it shows the directory listing of apache. 但是,当我尝试访问http://localhost/lara/blog它显示了apache的目录列表。 I followed the instruction in the documentation during the installation. 我在安装过程中遵循了文档中的说明。

I noticed the following notes: 我注意到以下注意事项:

  1. C:\\xampp\\htdocs\\lara\\blog does not has any index.php or .htaccess C:\\xampp\\htdocs\\lara\\blog没有任何index.php或.htaccess
  2. C:\\xampp\\htdocs\\lara\\blog\\app also, does not has any index.php or .htaccess C:\\xampp\\htdocs\\lara\\blog\\app也没有任何index.php或.htaccess
  3. Only accessing http://localhost/lara/blog/public opens a page with the laravel logo and the words "You have arrived" 只访问http://localhost/lara/blog/public打开一个带有laravel徽标和“你已经到达”字样的页面

I could not able to know what's the problem? 我无法知道这是什么问题?

Laravel's folder structure uses the public folder as the WWW root, effectively placing all your application's files outside of the web root to help keep them secure. Laravel的文件夹结构使用public文件夹作为WWW根,有效地将应用程序的所有文件的Web根目录以外的帮助让他们的安全。 What you are experiencing is normal. 你正在经历的是正常的。

You'll have to either access your application from the http://localhost/lara/blog/public URL, or set up a virtual host URL (eg http://testblog.dev ) that is pointed to the public folder. 您必须从http://localhost/lara/blog/public URL访问您的应用程序,或者设置指向公用文件夹的虚拟主机URL(例如http://testblog.dev )。 I do not develop on Windows/XAMPP so I cannot specifically tell you how to do that part. 我没有在Windows / XAMPP上开发,所以我不能具体告诉你如何做这个部分。

如果你正在运行php> 5.4,你也可以从命令提示符使用内置服务器来提供应用程序(用于开发目的):

php artisan serve

I have an answer on How to install Laravel via Laravel Installer on Windows? 我有一个关于如何在Windows上通过Laravel Installer安装Laravel的答案

or 要么

http://goo.gl/uftcSo for more details http://goo.gl/uftcSo了解更多详情

Hope that helps. 希望有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM