当我通过Composer创建本地项目时,我运行了我的应用程序,没有问题。

现在我部署了我的应用程序并试图点击进入点(“/”),它有效:它执行预期的重定向到/ home。

但是/ home是问题:我得到(在生产中)空(空白)响应,并且错误日志显示:

[24-Feb-2014 20:14:11] PHP致命错误:要求()[function.require]:在第21行的'__DIR__/../bootstrap/autoload.php'中的失败打开必需的'.:/usr/lib64/php:/usr/share/pear'(include_path= /home1/centrau9/public_html/index.php

注意:文件存在,和/ bootstrap /的权限为0755,而autoload.php的权限为0644.该框架是www-trourable(即public_html对应于Laravel项目的“公共”目录)。

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