我有带Apache2的PHP,我想在没有Artisan的情况下运行Laravel框架,但我不能!有人知道如何在没有 artisan 的情况下管理拉威尔吗?

推荐答案

I've solved the problem. The problem was in my htaccess and in mod_rewrite (Apache2). Now I can connect to my application only by typing localhost/public..

如果任何人想要公开应用程序,更简单、最快的方法是:

  • 将根目录中的"server.php"文件重命名为"index.php"
  • Move your .htaccess from public folder to root directory
  • 使Apache2(set correct file/folder permissions)可以访问您的目录.

感谢所有用户的帮助!:)

Important Edit

考虑使用Apache Virtual Hosts(指向虚拟主机到/公共LaaLip文件夹),而不是重命名服务器.php来索引.php,因为这样做,在视图中使用Laravel的asset()函数时,需要加上前缀"public/".

When working with other devs, who are using a different configuration, this might be a big problem because they will be able to see the assets while you will not (or viceversa).

Laravel相关问答推荐

Laravel-如何按第三表关系对数据进行分类

如何在 Laravel 中填充以后执行的条件

如何在 laravel 5.3 中验证没有 auth:api 中间件的用户?

处理程序类中的错误 - Laravel

laravel 控制器中的全局变量

如何使用 Eloquent Laravel 更新集合

Laravel Blade 没有额外的空格?

Laravel 5 文件下载:stream() 或 download()

Laravel 随机排序

如何在包中安排 Artisan 命令?

在 Laravel 中显示已注册的路由

如何在 Laravel 5.1 中改变环境?

Heroku CLI 安装错误:PATH 未更新,原始长度 1585 > 1024

加载模型的所有关系

在 Laravel 4 中使用 HTML 占位符

Mac OS X 需要 Mcrypt PHP 扩展

如何在 Laravel 中 Refresh刷新用户对象?

使用 Laravel Mix 合并多个文件

Laravel 更新查询

Laravel - Union + 分页?