如何在共享主机上部署laravel 4.2? [英] How to deploy laravel 4.2 on shared hosting?

查看:60
本文介绍了如何在共享主机上部署laravel 4.2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用laravel 4.2.8开发了一个应用程序,但是现在在部署它时遇到了麻烦.我遵循了这个答案 https://stackoverflow.com/a/16683938/3153380 ,但它无法正常工作.我出现白屏,并且标题返回500 Internal Server Error状态.

I developed an application with laravel 4.2.8 and now I am having trouble deploying it. I followed this answer https://stackoverflow.com/a/16683938/3153380 but its not working. I am getting a white screen and the headers are returning a 500 Internal Server Error status.

我了解到,laravel 4.2在共享主机上设置有点棘手,这是真的吗?我似乎可以找到一个有效的解决方案,因此那些在之前部署过4.2的人请提供帮助.我的文件夹结构如下所示

I read around that laravel 4.2 is a bit tricky to set up on shared hosting is this true? I can seem to find a working solution so those that have deployed 4.2 before please help. My folder structure is like below

root/ laravel_base/ 应用程序/ ... public_html/ siteroot/ 资产/ 套餐/ 上传/ index.php ... 有指针吗?

root/ laravel_base/ app/ ... public_html/ siteroot/ assets/ packages/ uploads/ index.php ... Any pointers?

推荐答案

首先请确保您的共享主机运行php> = v5.4.第二次尝试按照以下步骤操作:

First make sure that your shared host runs php >= v5.4. Second try to follow this steps:

  1. public_html/www/之外创建一个文件夹.例如:project/
  2. 将laravel应用中的每个文件夹和文件(公用文件夹除外)复制到该project/文件夹
  3. public/文件夹的内容复制到public_html/www/ (.htaccess也必须存在)
  4. 在public/内部,找到index.php文件并更改以下路径:

  1. Create a folder outside your public_html/ or www/. Ex: project/
  2. Copy every folder and file (except the public folder) from your laravel app into that project/ folder
  3. Copy the content of public/ folder into your public_html/ or www/ (the .htaccess must be there too)
  4. Inside public/ locate the index.php file and change the following paths:

a. autoload.php

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

进入

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

b. start.php

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

进入

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

毕竟应该可以工作.

这篇关于如何在共享主机上部署laravel 4.2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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