doutui9606 2015-09-08 06:40
浏览 48

如何在共享主机上托管基于laravel4的应用程序

I have read lots of tutorial on hosting laravel 4 based app on shared hosting .But I am not able to deploy it successfully . I am getting following error

Warning: require(__DIR__/../bootstrap/autoload.php) [function.require]: failed to open stream: No such file or directory in D:\Hosting\10588605\html\healthscape\ideconnect\public\index.php on line 41

Fatal error: require() [function.require]: Failed opening required '__DIR__/../bootstrap/autoload.php' (include_path='.;C:\php5\pear') in D:\Hosting\10588605\html\healthscape\ideconnect\public\index.php on line 41

I have website in which I want to deploy my app . For example I have this website .

http://healthscapeseries.com

I want to add my laravel app to this like

http://healthscapeseries.com/myappname/public/

it should point to my app. Can any one help me out with this .

Thanks in advance

  • 写回答

1条回答 默认 最新

  • doucai1901 2015-09-23 06:50
    关注

    It will be better if you point to your app like

    http://healthscapeseries.com/myappname

    For attaining this do following steps

    1. Create a folder myappnamebase in your document folder

    2. Put all your contents of the application except the public folder content to myappnamebase folder

    3. Create new folder in public_html named myappname

    4. Put all your public folder content in myappname folder

    Then bring the following changes:

    Inside public_html->myappname->index.php

    instead of

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

    add

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

    instead of

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

    add

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

    Inside myappnamebase->bootstrap->paths.php do editting so that it looks like following

    'app' => __DIR__.'/../../myappnamebase/app',
    
    'public' => __DIR__.'/../../public_html/myappname',
    
    'base' => __DIR__.'/../../myappnamebase',
    
    'storage' => __DIR__.'/../../myappnamebase/app/storage',
    
    评论

报告相同问题?

悬赏问题

  • ¥15 mmocr的训练错误,结果全为0
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀