我修改了一个在localhost中工作正常的laravel系统。但是当我把它放在实时服务器中时,它会产生500个错误
我的.env文件在下面给出
APP_ENV=local
APP_DEBUG=false
APP_KEY=636MdJTzWw6ZgHIQXTFMGattFtXVm75v
DB_HOST=localhost
DB_DATABASE=*****
DB_USERNAME=*****
DB_PASSWORD=Snl,4}38yZ$i
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
我的.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>
我的public / index.php文件在这里
require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../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);
希望得到积极回应的家伙...... 更新: 我查看了error_log文件并显示错误
[17-Apr-2016 07:45:28 Etc/GMT] PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/web/public_html/attendance/public/index.php on line 50
答案 0 :(得分:4)
根据错误消息,我怀疑您的PHP版本低于5.5。
摘自PHP文档:
:: class
自PHP 5.5起,class关键字也用于类名 解析度。您可以获取包含完全限定名称的字符串 使用ClassName :: class的ClassName类。这是特别的 对命名空间类有用。
Laravel需要PHP 5.5.9或更新版