且构网

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

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

更新时间:2023-02-26 22:10:20

首先请确保您的共享主机运行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';`

毕竟应该可以工作.