[英]Errors “Page expired” when upload project Laravel to Shared hosting (Cpanel)
I have a problem after Uploading my Laravel project to shared hosting.将我的 Laravel 项目上传到共享主机后,我遇到了问题。 Everything is ok when I test by Xampp(Localhost).
当我通过 Xampp(Localhost) 测试时一切正常。 But in production on shared hosting, I click "Submit button" on every Form-> It appears: `Page Expired.
但是在共享主机的生产中,我在每个表单上单击“提交按钮”-> 出现:`页面已过期。 Although I have
Csrf_token
and have searched many questions about my problem, I cannot resolve it.虽然我有
Csrf_token
并且搜索了很多关于我的问题的问题,但我无法解决它。 Please help me!!!请帮我!!!
This is my form:这是我的表格:
<form action="{{ route('login') }}" method="post" autocomplete="off">
@csrf
<div class="form-group">
<label for="nrp">NRP</label>
<input class="form-control @error('nrp') is-invalid @enderror" type="number" name="nrp" id="nrp" autofocus required>
@error('nrp')
<span class="invalid-feedback" role="alert">
<strong>NRP / Password yang dimasukan salah!</strong>
</span>
@enderror
</div>
<div class="form-group">
<label for="password">Password</label>
<input class="form-control" type="password" name="password" id="password" required>
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="d-flex mb-5 mt-2 align-items-center">
<label class="control control--checkbox mb-0">
<span class="caption">Remember me</span>
<input type="checkbox" name="remember" />
<div class="control__indicator"></div>
</label>
<span class="ml-auto">
<a href="{{ route('user.register') }}" class="forgot-pass">Register Account</a>
</span>
</div>
<input type="submit" value="Log In" class="btn btn-block btn-primary">
</form>
The Route:路线:
Auth::routes(['verify' => true]);
I'm using laravel/ui
for auth.我正在使用
laravel/ui
进行身份验证。
Please check the website for the example of the error http://etwpad.id/login请检查网站以获取错误http://etwpad.id/login的示例
Try creating an application key.尝试创建应用程序密钥。
Run php artisan key:generate
.运行
php artisan key:generate
。 This will create a key and place it in your .env
file ( APP_KEY
).这将创建一个密钥并将其放置在您的
.env
文件 ( APP_KEY
) 中。
Then php artisan config:cache
.然后
php artisan config:cache
。 This will clear you cache for use of the new key.这将清除您使用新密钥的缓存。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.