2017-02-16 173 views
0

當我試圖提交表單時,或者當試圖登錄時,當我點擊註冊時,我得到HTTP錯誤500.有趣的是,當我測試相同的應用程序在XAMPP本地,沒有問題,但看起來像我的網絡服務器確實有問題。TokenMismatchException在VerifyCsrfToken.php行68:

TokenMismatchException in VerifyCsrfToken.php line 68: 
in VerifyCsrfToken.php line 68 
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 137 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33 
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49 
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 137 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33 
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64 
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 137 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33 
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37 
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 137 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33 
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59 
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 137 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33 
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104 
at Pipeline->then(object(Closure)) in Router.php line 655 
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 629 
at Router->dispatchToRoute(object(Request)) in Router.php line 607 
at Router->dispatch(object(Request)) in Kernel.php line 268 
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53 
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46 
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33 
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104 
at Pipeline->then(object(Closure)) in Kernel.php line 150 
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 117 
at Kernel->handle(object(Request)) in index.php line 54 

網站可瀏覽:

Webuilder

所以這裏的問題是:爲什麼我會在我的網絡服務器,但在XAMPP這個錯誤,當地一切正常

/編輯://

添加鱈魚E:

形式:

@extends('layouts.master') @section('title', 'Website Builder') @section('content') 
<meta name="csrf-token" content="{{ csrf_token() }}" /> 
<div class=flex-container> 
    <div class="flex-item templates"> 

     @foreach ($templates as $template) 
     <a class="content-link" href="{{ asset($template->file)}}"> 
     <img class="template_img" src="{{ asset($template->image)}}"/> 
     </a> @endforeach 

    </div> 

    <span class="glyphicon glyphicon-chevron-left hiding_template left_side arrows"></span> 
    <span class="glyphicon glyphicon-chevron-right hiding_features right_side arrows"></span> 
    <div class="pace pace-inactive"> 
     <div class="pace-progress" data-progress-text="100%" data-progress="99" style="width: 100%;"> 
      <div class="pace-progress-inner"></div> 
     </div> 
     <div class="pace-activity"></div> 
    </div> 
    <div id="content-link2" class="flex-item2"> 
    @if (session('status')) 
    <div id="mydiv" class="alert alert-success"> 
     {{ session('status') }} 
    </div> 
    @endif 
    </div> 
    <div class="flex-item featuress"> 
     <input class="form-control filestyle margin images" data-input="false" type="file" data-buttonText="Upload Logo" data-size="sm" data-badge="false" onchange="readURL(this);" /> 

     <script> 
      $(function() { 
       $(document).tooltip(); 
      }); 
     </script> 
     <button style="display: none" class="form-control margin btn btn-primary hide_all" id="showColor">Show Colors</button> 
     <button style="display: none" class="form-control margin btn btn-primary hide_all" id="hideColor">Hide Colors</button> 
     <input title="Choose a color and then click on any box" style="display: none" class="btn btn-default form-control margin hide_all" type="color" id="colorChoice"> 
     <a style="display: none" href="#" class="btn btn-default form-control margin hide_all" id="cp4">Background</a> 

     <button style="display: none" onclick="$('#fonts1').bfhfonts({font: 'Arial'})" id="fontsShow" class="btn btn-primary form-control margin hide_all">Load Fonts</button> 
     <button style="display: none" class="btn btn-primary form-control margin hide_all" id="fontsHide">Hide Fonts</button> 
     <select title="Choose a font and then click on any box" style="display: none" id="fonts1" class="form-control margin hide_all"></select> 

     <button style="display: none" onclick="$('#googlefonts1').bfhgooglefonts({font: 'Lato'})" id="googleShow" class="btn btn-primary form-control margin hide_all">Google fonts</button> 
     <button style="display: none" class="btn btn-primary form-control margin hide_all" id="googleHide">Hide Google</button> 
     <select title="Choose a font and then click on any box" style="display: none" id="googlefonts1" class="form-control margin hide_all"></select> 

     <button style="display: none" onclick="$('#fontsizes1').bfhfontsizes({fontsize: '12'})" id="sizeShow" class="btn btn-primary form-control margin hide_all">Load font size</button> 
     <button style="display: none" class="btn btn-primary form-control margin hide_all" id="sizeHide">Hide font size</button> 
     <select title="Choose a font size and then click on any box" style="display: none" id="fontsizes1" class="form-control margin hide_all"></select> 

     <button style="display: none" class="form-control margin btn btn-warning hide_all" id="finishEdit">Done</button> 
     <button class="form-control margin btn btn-default" id="startEdit">Edit</button> 


     <button class="btn btn-success form-control margin " data-toggle="modal" data-target="#myModalHorizontal"> 
    Save Website 
</button> 

     <!-- Modal --> 
     <div class="modal fade" id="myModalHorizontal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 
      <div class="modal-dialog"> 
       <div class="modal-content"> 
        <!-- Modal Header --> 
        <div class="modal-header"> 
         <button type="button" class="close" data-dismiss="modal"> 
         <span aria-hidden="true">&times;</span> 
         <span class="sr-only">Close</span> 
       </button> 
         <h4 class="modal-title" id="myModalLabel"> 
          Website Name 
         </h4> 
        </div> 
        <div class="modal-body"> 
         <form action="{{ action('[email protected]') }}" class="form-horizontal" role="form" method="POST"> 
          <div class="form-group"> 
           <input type="hidden" name="_token" value="{{ csrf_token() }}"> 
           <input type="hidden" id="code" name="newCode" value=""> 
           <input type="hidden" id="name" name="newName" value=""> 
           <label class="col-sm-2 control-label" for="website_name">Name</label> 
           <div class="col-sm-10"> 
            <input type="text" class="form-control" id="website_name" placeholder="Website Name" /> 
           </div> 
          </div> 
        </div> 

        <!-- Modal Footer --> 
        <div class="modal-footer"> 
         <button type="button" class="form-control margin btn btn-danger" data-dismiss="modal"> 
          Close 
       </button> 
         <button onClick=" updateDatabase(this);" type="submit" class="form-control margin btn btn-success" id="getRequest changes"> 
        Save Website 
       </button> 
        </div> 
       </div> 
      </div> 
      </form> 

     </div> 
     </body> 
     <link href="{{asset('css/bootstrap-colorpicker.min.css')}}" rel="stylesheet" type="text/css"> 
     <link href="{{asset('css/bootstrap-formhelpers.min.css')}}" rel="stylesheet" type="text/css"> 
     <link href="{{asset ('//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css')}}" rel="stylesheet" type="text/css"> 
     <script type="text/javascript" src="{!! asset('js/bootstrap-colorpicker.min.js') !!}"> 
     </script> 
     <script type="text/javascript" src="{!! asset('js/bootstrap-formhelpers.js') !!}"> 
     </script> 
     <script type="text/javascript" src="{!! asset('js/template.js') !!}"></script> 
     <script type="text/javascript" src="{!! asset('js/bootstrap-filestyle.min.js') !!}"> 
     </script> 

     </html> 
     @endsection @show 

登錄:

@extends('layouts.master') 

@section('content') 
<div class="container forms"> 
    <div class="row"> 
     <div class="col-md-8 col-md-offset-2"> 
      <div class="panel panel-default"> 
       <div class="panel-heading">Login</div> 
       <div class="panel-body"> 
        <form class="form-horizontal" role="form" method="POST" action="{{ url('/login') }}"> 
         {{ csrf_field() }} 

         <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}"> 
          <label for="email" class="col-md-4 control-label">E-Mail Address</label> 

          <div class="col-md-6"> 
           <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus> 

           @if ($errors->has('email')) 
            <span class="help-block"> 
             <strong>{{ $errors->first('email') }}</strong> 
            </span> 
           @endif 
          </div> 
         </div> 

         <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}"> 
          <label for="password" class="col-md-4 control-label">Password</label> 

          <div class="col-md-6"> 
           <input id="password" type="password" class="form-control" name="password" required> 

           @if ($errors->has('password')) 
            <span class="help-block"> 
             <strong>{{ $errors->first('password') }}</strong> 
            </span> 
           @endif 
          </div> 
         </div> 

         <div class="form-group"> 
          <div class="col-md-6 col-md-offset-4"> 
           <div class="checkbox"> 
            <label> 
             <input type="checkbox" name="remember"> Remember Me 
            </label> 
           </div> 
          </div> 
         </div> 

         <div class="form-group"> 
          <div class="col-md-8 col-md-offset-4"> 
           <button type="submit" class="btn btn-primary"> 
            Login 
           </button> 

           <a class="btn btn-link" href="{{ url('/password/reset') }}"> 
            Forgot Your Password? 
           </a> 
          </div> 
         </div> 
        </form> 
       </div> 
      </div> 
     </div> 
    </div> 
</div> 
@endsection 

註冊:(這裏我得到錯誤500)

@extends('layouts.master') 

@section('content') 
<div class="container forms"> 
    <div class="row"> 
     <div class="col-md-8 col-md-offset-2"> 
      <div class="panel panel-default"> 
       <div class="panel-heading">Register</div> 
       <div class="panel-body"> 
        <form class="form-horizontal" role="form" method="POST" action="{{ url('/register') }}"> 
         {{ csrf_field() }} 

         <div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}"> 
          <label for="name" class="col-md-4 control-label">Name</label> 

          <div class="col-md-6"> 
           <input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" required autofocus> 

           @if ($errors->has('name')) 
            <span class="help-block"> 
             <strong>{{ $errors->first('name') }}</strong> 
            </span> 
           @endif 
          </div> 
         </div> 

         <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}"> 
          <label for="email" class="col-md-4 control-label">E-Mail Address</label> 

          <div class="col-md-6"> 
           <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required> 

           @if ($errors->has('email')) 
            <span class="help-block"> 
             <strong>{{ $errors->first('email') }}</strong> 
            </span> 
           @endif 
          </div> 
         </div> 

         <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}"> 
          <label for="password" class="col-md-4 control-label">Password</label> 

          <div class="col-md-6"> 
           <input id="password" type="password" class="form-control" name="password" required> 

           @if ($errors->has('password')) 
            <span class="help-block"> 
             <strong>{{ $errors->first('password') }}</strong> 
            </span> 
           @endif 
          </div> 
         </div> 

         <div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}"> 
          <label for="password-confirm" class="col-md-4 control-label">Confirm Password</label> 

          <div class="col-md-6"> 
           <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required> 

           @if ($errors->has('password_confirmation')) 
            <span class="help-block"> 
             <strong>{{ $errors->first('password_confirmation') }}</strong> 
            </span> 
           @endif 
          </div> 
         </div> 

         <div class="form-group"> 
          <div class="col-md-6 col-md-offset-4"> 
           <button type="submit" class="btn btn-primary"> 
            Register 
           </button> 
          </div> 
         </div> 
        </form> 
       </div> 
      </div> 
     </div> 
    </div> 
</div> 
@endsection 

路線:

Route::group(['middleware' => ['web']], function() { 

    Route::get('home', '[email protected]'); 
    Route::get('pages', '[email protected]'); 
    Route::get('template', '[email protected]'); 
    Route::post('template', '[email protected]'); 
    Route::get('logout', '[email protected]'); 
    Route::get('/website/{name}', '[email protected]'); 
}); 
Route::get('/', function() { 
    return view('layouts/home'); 
}); 
Auth::routes(); 

Route::group(['prefix' => 'admin'], function() { 
    Voyager::routes(); 
}); 
+0

您的鏈接已損壞,但即使不是,您應該張貼代碼而不僅僅是鏈接。 – Samsquanch

+0

https://www.webuilder.co.uk/鏈接工作正常 – Przemek

+0

,我不完全確定你需要什麼代碼,因爲相同的代碼在本地工作正常,只是不在服務器上 – Przemek

回答

1

確保您已獲得寫入權限。 轉到您的根文件夾並編寫這兩個命令。

chmod 777 -R storage/logs 
chmod 777 -R bootstrap/cache 

沒有這些命令Laravel將不能夠做到高速緩存和日誌打印錯誤(如果需要)。 Laravel將需要這些文件許可。

相關問題