laravel在去寻址时我看到文件夹,而不是启动应用程序 [英] laravel when going to address I see folders, not starting the app

查看:48
本文介绍了laravel在去寻址时我看到文件夹,而不是启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有xampp.

我使用composer安装了laravel,并且有目录"laravel-test"

I installed laravel using composer, and there is directory 'laravel-test'

我去

http://[localhost]/laravel-test/

http://[localhost]/laravel-test/

然后我只看到文件夹.

但是当我转到其他代码-例如写在codeigniter上的http://[localhost]/darzelis/时,它可以工作.因此,这意味着xammp可以正常工作,但是laravel无法启动.

But when I go to some other - like http://[localhost]/darzelis/ which is written on codeigniter, it works. So it means xammp is working, but somehow laravel does not start.

我要通过 http://laravel.com/docs/quick

并且在创建第一个路线-用户后陷入困境.

and am stuck after creating first route - users.

推荐答案

配合,首先Laravel的入口是/public/目录.它包含index.php文件,请尝试将浏览器指向http://[localhost]/laravel-test/public,以检查一切是否正常.

Mate, firstly Laravel's entry point is the /public/ directory. It contains the index.php file, try pointing your browser to http://[localhost]/laravel-test/public to check if things work.

查看文件夹还取决于您的服务器配置,最好阻止Apache行为.

Seeing the folders is also dependable on you server configuration, it's good to block that Apache behaviour.

最后但并非最不重要的一点是,在生产环境中部署laravel,请确保用户只能访问公共目录,而不是laravel文件夹的整个结构(在您的情况下为laravel-test),这同样取决于Apache配置(虚拟主机doc根目录).

Last but not least, deploying laravel in production environment , make sure that the users can access ONLY the public directory not the whole structure of your laravel folder (in your case laravel-test), which again is dependable on the Apache configuration (vhost doc root).

这篇关于laravel在去寻址时我看到文件夹,而不是启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆