Вопрос

Когда я создал локальный проект через композитор, я запустил мое приложение без проблем.

Теперь я развернул мое приложение и попытался ударить точку входа («/»), и он работает: он выполняет ожидаемый перенаправление на / домой.

Но / home - это проблема: я получаю (в производстве) пустой (пустой) ответ, а журнал ошибок показывает:

[24-FEB-2014 20:14:11] PHP FATAL ОШИБКА: требуется () [Функция .Require]: Неудачное открытие требуется '__DIR__/../bootstrap/autoload.php' (inclue_Path= '.:/usr/lib64/php:/usr/share/pear') в /home1/centrau9/public_html/index.php в строке 21

Примечание. Файл существует, и разрешения / загрузка / находятся 0755, а разрешения для Autoload.php являются 0644. Рамочная структура www-недоступна (т.е. public_html соответствует "общественному" каталогу проекта laravel).

Файл Marross.php выглядит следующим образом:

<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

define('STATIC_URL', '/static/');

Route::get('/', function()
{
    return Redirect::route('home');
});

Route::get('home', array('as' => 'home', function()
{
    return Response::make(
        View::make('home_html'), 200,
        array('Content-Type' => 'text/html; charset=utf-8')
    );
}));

Route::get('nosotros', array('as' => 'nosotros', function()
{
    return Response::make(
        View::make('nosotros_html'), 200,
        array('Content-Type' => 'text/html; charset=utf-8')
    );
}));

Route::get('modelos/{clase}/{modelo}', array('as' => 'modelos', function($clase, $modelo)
{
    $modelos = CentralCarController::datosModelos();
    if (!isset($modelos[$clase]))
    {
        App::abort(404, 'No se puede encontrar la página');
    }
    $datosModelo = null;
    foreach($modelos[$clase] as $modelo_)
    {
        if ($modelo_['name'] == $modelo)
        {
            $datosModelo = $modelo_;
        }
    }
    if (!$datosModelo)
    {
        App::abort(404, 'No se puede encontrar la página');
    }

    return Response::make(
        View::make('modelos_html', array('model_class' => json_encode($clase), 'model_name' => json_encode($modelo))), 200,
        array('Content-Type' => 'text/html; charset=utf-8')
    );
}))->where(array('clase' => '[\w-]+', 'modelo' => '[\d\w-]+'));

Route::get('posventa', array('as' => 'posventa', function()
{
    return Response::make(
        View::make('posventa_html'), 200,
        array('Content-Type' => 'text/html; charset=utf-8')
    );
}));

Route::match(array('GET', 'POST'), 'contacto', array('as' => 'contacto', 'uses' => 'CentralCarController@contactoConsulta'));
Route::match(array('GET', 'POST'), 'contacto-cotizar', array('as' => 'contacto-cotizar', 'uses' => 'CentralCarController@contactoCotizar'));
Route::match(array('GET', 'POST'), 'contacto-cita', array('as' => 'contacto-cita', 'uses' => 'CentralCarController@contactoTaller'));
Route::get('contacts-export/{periodo?}', array('as' => 'exportar', 'uses' => 'CentralCarController@exportar'))->where(array('periodo' => '[DWMY]|6M'));
Route::get('models-data', array('as' => 'models-data', 'uses' => 'CentralCarController@modelos'));
Route::get('busqueda', array('as' => 'busqueda', 'uses' => 'CentralCarController@busqueda'));
.

и файл .htaccess в public_html следующим образом:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
.

Это было полезно?

Решение

Вы, вероятно, работаете PHP 5.2.Проверьте свою версию PHP.Вам нужно> 5.3

Другие советы

Нашел ответ: неправильная версия PHP (5.2.x).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top