2016-10-20 4 views
3

Я хотел бы загрузить свой проект laravel 4 в общий, я создал отдельную папку laravel, загрузив все содержимое, за исключением общей папки, затем взял все содержимое в общую папку и переместил их в мою папку public_html.Загрузка Laravel 4 на общий хостинг

Я изменил index.php в своем public_html и изменил файл server.php в папке laravel. есть какой-то шаг, который я пропустил, потому что я все еще получаю пустую страницу, когда запускаю свою страницу.

public_html/index.php

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

/* 
|-------------------------------------------------------------------------- 
| Register The Auto Loader 
|-------------------------------------------------------------------------- 
| 
| Composer provides a convenient, automatically generated class loader 
| for our application. We just need to utilize it! We'll require it 
| into the script here so that we do not have to worry about the 
| loading of any our classes "manually". Feels great to relax. 
| 
*/ 

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

/* 
|-------------------------------------------------------------------------- 
| Turn On The Lights 
|-------------------------------------------------------------------------- 
| 
| We need to illuminate PHP development, so let's 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 these users. 
| 
*/ 

$app = require_once __DIR__.'../laravel/bootstrap/start.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 whipped up for them. 
| 
*/ 

$app->run(); 

Laravel/server.php

<?php 

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

$uri = urldecode($uri); 

$paths = require __DIR__.'/bootstrap/paths.php'; 

$requested = $paths['public_html'].$uri; 

// 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($requested)) 
{ 
    return false; 
} 

require_once $paths['public_html'].'/index.php'; 

Ваша помощь будет очень цениться только начал изучать Laravel.

+1

Изменение разрешений на 'storage' папку на 775. – xpuc7o

+0

Почему ты«только начал обучение Laravel»с устаревшей версией? Используйте Laravel 5.3. – ceejayoz

ответ

0

Если папка находится вне public_html и изменить пути в общественных/index.php

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

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

Все папки должны быть вне public_html, например myproject. Затем в public_html создайте ту же папку myproject и разместите содержимое public прямо здесь.

Изменить разрешение app/storage на 775

+0

как насчет файла сервера. Я могу изменить $ paths ['public']. Я пробовал, и он не работает. – Taps101