Leravel 5的部署越来越:Laravel 5部署得到内部服务器错误
内部服务器错误
服务器遇到一个内部错误或配置错误,无法完成您的请求
我的文件结构:
|
|-pub -> from laravel folder public
|-my_apps
|- my_first_app -> all other files from laravel project
|- app
|- bootstrap
|- config
|- database
|- resources
|- storage
|- ...
我设置了存储文件夹的权限为:
用户:: RWX
组:: RWX
其他:: RWX
这是我的目录.htaccess文件/pub
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase/<-------- I added this line
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
</IfModule>
我也改变\pub\index.php
<?php
//updated path
require __DIR__.'/../my_apps/my_first_app/bootstrap/autoload.php';
//updated path
$app = require_once __DIR__.'/../my_apps/my_first_app/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
P我的本地机器上的惠普是PHP 5.6,它是PHP 5.5。我试过后RewriteEngine On
行添加
AddHandler application/x-httpd-php55 .php
在.htaccess。
更新
服务器运行PHP 5.5.0,所以我降级我Laravel 5.1至5.0,而现在它工作在宅基地。 而我下面https://medium.com/laravel-news/the-simple-guide-to-deploy-laravel-5-application-on-shared-hosting-1a8d0aee923e#.50q2s8wer在这一刻部署。 降级实际上未能当我检查laravel
检查laravel和apache日志以获取有关错误本质的更多信息。 –
检查PHP版本 – sixFingersMan
PHP版本5.5.0在服务器上,我使用PHP 5.6在家园开发 – daolincheng