1. 程式人生 > >thinkphp5 專案筆記

thinkphp5 專案筆記

1、解決500錯誤(index.php首頁為空白頁面)(1)在index.php開頭,開啟報錯,如下error_reporting(E_ALL);ini_set('display_errors', '1');(2)開啟nginx配置的錯誤日誌2、問題:Warning: require(): open_basedir restriction in effect. File(/home/stone/dsales/src_web/v1r0/simplewind/thinkphp/base.php) is not within the allowed path(s): (/home/stone/dsales/src_web/v1r0/public/:/tmp/:/proc/) in /home/stone/dsales/src_web/v1r0/public/index.php
on line 38解決(1)檢查php.ini的 open_basedir的引數(2)如果是lnmp(nginx伺服器),檢查 path/nginx/conf/fastcgi.conf裡的 $document_root引數fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/:/home/stone/dsales/"; (/home/stone/dsales/為專案路徑)注意:如果在fastcgi.conf裡沒有 fastcgi_param PHP_ADMIN_VALUE……自行新增3、問題session驅動使用redis時,出現:session_start(): Failed to initialize storage module: user (path: )
解決(1):在php.ini中 把session.save_handler = files修改為session.save_handler = user(這個好像不用改)解決(2):在TP5中,因為要用到redis,所以會在…path\simplewind\thinkphp\library\think\session\driver\Redis.php 75行呼叫到php的擴充套件函式(new \Redis)->close(),所以如果發現專案載入奇慢,要考慮到是否開啟或載入了php-redis函式擴充套件庫(注意:不是redis,而是php-redis擴充套件,可用phpinfo檢視)

4、TP框架本身自己封的方法dump有點問題,不能列印加密過的東西,如 openssl_sign;