如何将Laravel 5项目上传到实时Web服务器

时间:2015-03-20 05:22:52

标签: laravel-5

我认为它与Laravel 4上传完全相同。

我的设置如下,这是正确的吗?

我需要修改index.php文件的唯一文件,在我的情况下是techjobs文件夹吗?我修改了这个文件以适应目录结构。还有其他文件需要更改吗?

enter image description here

的index.php

<?php
/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <taylorotwell@gmail.com>
 */

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
|
*/

require __DIR__.'/../../techjobs-laravel-base/bootstrap/autoload.php';

/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/

$app = require_once __DIR__.'/../../techjobs-laravel-base/bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can simply call the run method,
| which will execute the request and send the response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/

$kernel = $app->make('Illuminate\Contracts\Http\Kernel');

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

$response->send();

$kernel->terminate($request, $response);

1 个答案:

答案 0 :(得分:0)

现在,你的文件夹中有太多的步骤../。请尝试使用以下代替

require __DIR__.'/../techjobs-laravel-base/bootstrap/autoload.php';

$app = require_once __DIR__.'/../techjobs-laravel-base/bootstrap/app.php';