首頁  >  文章  >  php框架  >  TP6 Driver [Think] not supported的解決方案

TP6 Driver [Think] not supported的解決方案

善始善终
善始善终原創
2020-11-11 21:31:415918瀏覽

今天早上在做專案的時候,引用了thinkPHP6.0.5的框架,在引用視圖的時候出現這樣的問題:

TP6 Driver [Think] not supported的解決方案

然後查看官方手冊,是這樣解釋的:

TP6 Driver [Think] not supported的解決方案

告訴我們新版不再內建think-template模板引擎,如果需要使用ThinkPHP官方模板引擎,需要單獨安裝think-view模板引擎驅動擴展。

因此透過進入到專案的根目錄下,透過composer安裝think-view模板引擎驅動擴充。

composer  require topthink/think-view

TP6 Driver [Think] not supported的解決方案

出現這樣的錯誤:Package topthink/think-view at version  has a PHP requirement incompatible with your PHP version (5.6.27)

#出現原因:我之前安裝了composer,預設的是PHP5.6.27的版本! ,而thinkPHP6.0.X需要PHP版本是7.1 。

解決方案:打開D:\phpStudy\PHPTutorial\tools\composer\composer.bat,修改裡面的php路徑為你想要切換的php版本路徑,然後點擊執行該bat檔案即可。

如果還是不行,那就重新安裝composer,下載網址:https://getcomposer.org/download/。然後選擇對應的路徑,選擇PHP>=7.1版本就可以了。

以上是TP6 Driver [Think] not supported的解決方案的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn