douyouzheng2209 2013-10-04 10:40
浏览 63
已采纳

在共享主机上托管在Laravel 4上运行的两个不同应用程序

I'm about to start development of a site using Laravel4 that will include a cms hosted on a sub-domain. What I want to know if is there is a way to have the main Laravel installation shared between the two apps?

I've had various success in testing using the following example: Laravel full URL routing, however I want to keep the functionality from the app folder separate and have something like say, app_main, app_cms that holds the relevant models, views and controllers for each site in there.

There doesn't seem to be much help that I can find in how to set up Laravel for such a requirement, so any help on this would be great.

  • 写回答

3条回答 默认 最新

  • dongtuo3795 2013-10-04 12:35
    关注

    I have a multihosting solution, which after logging into FTP contains this folders:

    domaina.com
    domainb.com
    domainc.com
    

    If I'd like to share same Laravel code between those websites, I just create 'Laravel' folder on the same level, so it looks just like this:

    domaina.com
    domainb.com
    domainc.com
    laravel
    

    This 'laravel' folder holds everything except 'app' & 'public' directory.

    I just place content of 'public' directory right inside 'domaina.com' folder (for example). Open up 'index.php' and adjust these lines to match actual location. Now you are good to go

    require __DIR__.'/../bootstrap/autoload.php';
    
    $app = require_once __DIR__.'/../bootstrap/start.php';
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里