[英]An unexpected error occurred. Using $this when not in object context error in Concrete 5 on PHP 5.6
我正在運行2012年舊版的Concrete 5(5.5.2.1),每次頁面加載時我都遇到一個突發問題,出現以下錯誤:
一個意料之外的問題發生了。 不在對象上下文中時使用$ this
這是造成錯誤的代碼,或者至少是調用代碼:
## now we display (provided we've gotten this far)
$v = View::getInstance();
$v->render($c);
當我用var_dump轉儲$ v時,我得到了:
object(View)#4 (8) {
["viewPath":"View":private]=> NULL
["controller"]=> NULL
["headerItems":"View":private]=> array(0) { }
["footerItems":"View":private]=> array(0) { }
["themePaths":"View":private]=> array(8) {
["/dashboard"]=> string(9) "dashboard"
["/dashboard/*"]=> string(9) "dashboard"
["/page_forbidden"]=> string(8) "concrete"
["/page_not_found"]=> string(8) "concrete"
["/install"]=> string(8) "concrete"
["/login"]=> string(8) "concrete"
["/register"]=> string(8) "concrete"
["/maintenance_mode"]=> string(8) "concrete"
}
["areLinksDisabled":"View":private]=> bool(false)
["isEditingEnabled":"View":private]=> bool(true)
["error"]=> string(0) ""
}
不幸的是,我的廉價主機在cPanel中存在一個錯誤,這意味着我無法訪問錯誤日志來查看此錯誤的實際含義,行號,類等。
這是常見問題嗎? 我假設我的主機已經升級了PHP(當前為5.6.23),並且由於自去年5月修復錯誤以來沒有接觸Concrete 5,這已經破壞了我的安裝。
謝謝。
這確實是由我的主機將站點升級到PHP 7引起的。Concrete 5.5無法在PHP 7上運行。
恢復到PHP 5.6可以正常工作,現在站點恢復正常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.