簡體   English   中英

在ubuntu16.04上部署Laravel應用后獲取“未定義的變量”

[英]Getting “Undefined variable” AFTER deploying Laravel app on ubuntu16.04

在我的應用中,我與此類似

@extends('layout.master')

<?
$user = auth()->user();
$specialities_store_granted     = $user->can('specialities.store');
?>

@section('top-buttons')
    @if ($specialities_store_granted)
        //.....
    @endif
@stop  

每個頁面上的代碼都可以在我的本地計算機上正常運行。 但是,在Ubuntu上部署后,我在每個頁面上都得到一個類似於此的錯誤

   Undefined variable: specialities_store_granted (View: 
/var/www/....com/resources/views/specialities/specialities.blade.php)

可能是什么?

更改<? <?php

有一個PHP設置allow <? 但這在您的PHP安裝中已關閉。

還要注意,將不推薦使用此舊功能並將其刪除。 它僅存在以支持真正的舊代碼。 不要使用它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM