更改Laravel 5.1的公用文件夹

编程入门 行业动态 更新时间:2024-10-28 04:28:16
本文介绍了更改Laravel 5.1的公用文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直在寻找一种方法来更改laravel 5.1中公共文件夹的名称,因为主机只允许我使用htdocs文件夹.

I was looking for a way to change the public's folder name in laravel 5.1, since my host only allows me to use a htdocs folder.

推荐答案

我按照以下步骤操作,在这里提到: laracasts/discuss/channels/general-discussion/where-do-you-set-public-directory-laravel-5 :

I followed these steps, mentioned here : laracasts/discuss/channels/general-discussion/where-do-you-set-public-directory-laravel-5 :

  • 在bootstrap/app.php中,添加 $app->bind('path.public', function() { return base_path('htdocs'); });

  • 然后在/server.php中,将public的两次出现更改为htdocs(或您要使用的任何内容).

  • Then, in /server.php, change the two occurences of publicto htdocs (Or whatever you wan to use).

    我衷心希望在任何情况下都能奏效.

    I sincerely hope that'll work in every situation.

    我最近不得不做同样的事情,但是这次我的主机允许我删除"htdocs"文件夹(并且我具有ssh访问权限):

    I recently had to do the same, but this time my host allowed me to delete the "htdocs" folder (And I had a ssh access) :

    • 我将Laravel安装在"htdocs"文件夹下方的根文件夹中
    • 我删除了"htdocs"文件夹
    • 我创建了一个符号链接,将"htdocs"映射到"public":ln -s public htdocs
  • 更多推荐

    更改Laravel 5.1的公用文件夹

    本文发布于:2023-07-12 07:27:19,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1096858.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:文件夹   Laravel

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!