2

I am new to Laravel 5 and have realized that a lot has changed, I am more familiar with Laravel 4. I just tried uploading my site to a live VPS, I managed to change the URLs in index.php and server.php but I keep getting these errors:

NetworkError:

Which makes me believe there was something else I was supposed to change that I did not because these files are indeed there and my application works just fine on my localhost.

Also with the exception of my home page, the rest of the pages say not found when I click on their links.

This is my document structure:

Document Structure

index.php

<?php

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

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

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

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

$response->send();

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

server.php

<?php
/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <[email protected]>
 */

$uri = urldecode(
    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);

// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' and file_exists(__DIR__.'/../public_html'.$uri))
{
    return false;
}

require_once __DIR__.'/../public_html/index.php';
10
  • 1
    did you update the .env file ?? making sure you turn APP_DEBUG=false Commented Mar 25, 2015 at 16:22
  • No i did not, i will try that immediately. Commented Mar 25, 2015 at 16:23
  • Than you i did that and it worked, but now all my pages except my homepage say Not Found when i click on them. Is there something else i need to change? Commented Mar 25, 2015 at 16:26
  • you are good to go, you might need to check your server log, and verify what is going on. Commented Mar 25, 2015 at 16:38
  • 2
    as a friendly reminder make sure you never ever forget to update .env to APP_ENV=production APP_DEBUG=false before you bring them to live Commented Mar 25, 2015 at 16:44

1 Answer 1

2

Following step you have must followed to move local to live server in Laravel.

  1. Move all public folder data into root directory

  2. In index.php change path to require DIR.'/../bootstrap/autoload.php'; to require DIR.'/bootstrap/autoload.php';

    AND

    $app = require_once DIR.'/../bootstrap/app.php'; to $app = require_once DIR.'/bootstrap/app.php';

    and set file permission to 744

  3. In .htaccess file add following code after RewriteEngine On.

    RewriteBase /

  4. Change parameter in .env file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.