質問

Composer を使用してローカル プロジェクトを作成したとき、アプリケーションは問題なく実行できました。

ここで、アプリケーションをデプロイし、エントリ ポイント (「/」) に到達しようとしましたが、正常に動作しました。/home への予期されたリダイレクトが実行されます。

しかし、/home が問題です。(本番環境では) 空 (空白) の応答が返され、エラー ログに次のように表示されます。

[24-Feb-2014 20:14:11] PHP 致命的なエラー:require() [関数.require]:失敗したオープンが必要です '__DIR__/../bootstrap/autoload.php' (include_path='.:/usr/lib64/php:/usr/share/pear') で /home1/centrau9/public_html/index.php 21番線

注記:ファイルは存在し、/bootstrap/ の権限は 0755、autoload.php の権限は 0644 です。フレームワークは www に到達できません (つまり、public_html は、laravel プロジェクトの「public」ディレクトリに対応します)。

Routes.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'));

そして、public_html の .htaccess ファイルは次のとおりです。

<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