【问题标题】:How to make higher than "public_html" folder work for cpanel installation?如何使高于“public_html”的文件夹适用于 cpanel 安装?
【发布时间】:2014-07-07 18:33:27
【问题描述】:

我目前有一个基本的 cpanel 托管帐户。它有设置:

/home/mysite/ --> my home directory
/home/mysite/www --> symlink to the next folder
/home/mysite/public_html --> where all my files live

问题是,我安装了最新的 laravel,我有一个结构如下的网站:

/app/ --> appy stuff
/public/ ---> what needs to be exposed

我的问题是,我不想将所有内容都放入 /home/mysite,因为那里还有其他文件夹。有没有办法可以使 html 目录类似于:

/home/mysite/public_html/public

这样,如果人们打开 www.mysite.com,它会访问 /public 文件夹。而不是 /public_html 文件夹。有没有办法在基本的 cpanel 托管解决方案上做到这一点?

【问题讨论】:

    标签: laravel cpanel


    【解决方案1】:

    我知道这不是您想要的确切答案 - 但我就是这样做的。

    您将public 重命名为public_html,无需更改任何服务器设置。

    然后在你的 bootstrap/paths.php 文件中更改

    'public' => __DIR__.'/../public',
    

    'public' => __DIR__.'/../public_html',
    

    然后将其他文件夹放在需要的位置。试图乱用 cPanel 设置,将 Laravel 应用程序留在 public_html 文件夹中可能会导致问题。

    【讨论】:

      猜你喜欢
      • 2017-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-13
      • 2014-02-13
      • 2017-06-26
      • 2012-07-25
      相关资源
      最近更新 更多