安装多个Laravel 4项目子目录 [英] install multiple Laravel 4 projects to sub directories

查看:837
本文介绍了安装多个Laravel 4项目子目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想多Laravel 4个项目上传到我的Web服务器,而不是我的开发服务器。每个laravel 4应用程序装在自己的子目录中。如何使我的文件结构是什么?我已经搜索周围的htaccess的删除/公众的网址,但我一直不成功。该服务器仅用于测试目的,它允许其他人作为该项目正在兴建跟随。我知道他们都与离开laravel基础结构在这些目录中主要的安全问题,但同样他们只是出于测试目的,当这些项目完成后,他们将被删除,放在自己的托管服务器上。这是我的文件结构现在:

I'm trying to upload multiple Laravel 4 projects to my web server, not my development server. Each laravel 4 app is housed in their own subdirectory. How should my file structure be? I've searched around for a htaccess to remove the /public from the url but i've been unsuccessful. this server is for testing purposes only, it allows others to follow along as the project is being built. I know their are major security issues with leaving the laravel base structure in these directories, but again they are just for testing purposes and when the projects are complete they are removed and placed on their own hosting server. This is my file structure now:

-public_html /
主站html文件
           - 测试站点子目录文件夹
          -subdirectoryFolder
           -store /
            -laravel应用1
      -blog /
        -laravel应用2
      -newspaper
        -laravel应用3

-public_html/
main website html files
-Test Site Subdirectory Folder
-subdirectoryFolder
-Store/
-laravel app 1
-blog/
-laravel app 2
-newspaper
-laravel app 3

如果我安装在每一个子目录下的文件夹laravel应用程序(www.testsite.com/Store,www.testsite.com/blog,www.testsite.com/newspaper)每个应用程序的工作原理,但我想在去除公众链接的末尾,www.testsite.com/Store/public是什么显示在浏览器中。任何帮助,这个问题是很大的AP preciated。谢谢

if i install laravel app in each subdirectory folder (www.testsite.com/Store, www.testsite.com/blog, www.testsite.com/newspaper) each application works, however I am trying to remove the public at the end of the url, www.testsite.com/Store/public is what is shown in the browser. Any help with this problem is greatly appreciated. Thank you

推荐答案

将所有的内容包括:的index.php 在每个公共目录来存储,分别在博客和报纸。并更改以下行:

move all content include index.php in each public directory to Store, Blog and Newspaper respectively. and change the following line:

require __DIR__.'/../bootstrap/autoload.php';

$app = require_once __DIR__.'/../bootstrap/start.php';

require __DIR__.'/bootstrap/autoload.php';

$app = require_once __DIR__.'/bootstrap/start.php';

好运。

修改:对不起。你必须修改 /bootstrap/paths.php 为好,变

EDIT: Sorry. You have to edit /bootstrap/paths.php as well, change

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

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

这篇关于安装多个Laravel 4项目子目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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