ThinkPHP報錯問題筆記

2021-10-06 16:55:08 字數 837 閱讀 6997

執行php think run報如下錯誤:

php warning:  require(/tp/vendor/autoload.php): failed to open stream: no such file or directory in /tp/think on line 7

php fatal error: require(): failed opening required '/tp/vendor/autoload.php' (include_path='.:/usr/share/php') in /root/tp/think on line 7

ubuntu@ijuu8z:~/tp# sudo php think run

php warning: require(/tp/vendor/autoload.php): failed to open stream: no such file or directory in /tp/think on line 7

php fatal error: require(): failed opening required '/tp/vendor/autoload.php' (include_path='.:/usr/share/php') in /root/tp/think on line 7

解決方法:

1. cd 到該引用的根目錄,先刪除 composer.lock 檔案;

2. 重新在根目錄執行「composer install」,這樣就能重新生成 composer.lock 檔案了。

3.如果出現php版本不匹配,可用「composer install --ignore-platform-reqs」(忽略版本匹配)。

ThinkPHP真正疑難問題筆記

寫php的類,實際上,也就是把 php看作是 oop的語言,而那正是我所喜歡和熟悉的,如以前使用c 雖然以前php寫的可能是用oop的思想,但是並沒有支援oop的語言features,不過php的oop語法跟j a更接近 乙個很重要的常識 在程式語言中,只有函式中的 字串 型別,才用 引號,而語言中...

Thinkphp5 1 模板路徑報錯

版本 5.1.24 windows環境 報錯 模板檔案不存在 template index default index index.html 把小寫改大寫 入口檔案配置在 根目錄下 模板路徑 兩種方法都可以 view path template view path env get root path...

ThinkPHP學習筆記

thinkphp中的配置檔案 慣例配置 專案配置 除錯配置 分組配置 讀取配置 動態配置 擴充套件配置 慣例配置 是系統內建的乙個配置檔案 conf convention.php 專案配置 位於專案配置檔案目錄conf下面,檔名是config.php 除錯配置 在開啟除錯模式的狀態下,可以給專案設定...