且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在共享主机上部署 laravel 4.2?

更新时间:2023-02-26 22:05:33

首先确保您的共享主机运行 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 应用中的每个文件夹和文件(public 文件夹除外)复制到该 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:

一个.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';`

毕竟它应该可以工作.