Thinkphp5.0.24新建admin/controller/User.php后可以訪問這個控制器可以訪問localhost/User/index
2019-05-01
use think\Config;為什么不能用,
the import think\Config cannnot be resolved
類在think的libary下面能夠找到。
helper.php中也有,
但是這句就是報錯,
版本是5.0.24
think輸入提示中只有composer,任意其他類都有錯。
the import think\Config cannnot be resolved
類在think的libary下面能夠找到。
helper.php中也有,
但是這句就是報錯,
版本是5.0.24
think輸入提示中只有composer,任意其他類都有錯。
2019-04-24
'PHP_DATABASE' =>
array (size=3)
'hostname' => string 'localhost' (length=9)
'username' => string 'root' (length=4)
'password' => string 'root' (length=4)
我輸出這樣正常么
array (size=3)
'hostname' => string 'localhost' (length=9)
'username' => string 'root' (length=4)
'password' => string 'root' (length=4)
我輸出這樣正常么
2019-04-23
沒顯示系統環境變量的
打開php.ini,找到這樣幾行代碼:
; variables_order
;Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS"
然后,將;Default Value: "EGPCS"前面的分號去掉,整個配置變成:
; variables_order
Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS"
然后重啟Apache就可以了。
打開php.ini,找到這樣幾行代碼:
; variables_order
;Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS"
然后,將;Default Value: "EGPCS"前面的分號去掉,整個配置變成:
; variables_order
Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS"
然后重啟Apache就可以了。
2019-03-31
沒顯示.env加載文件內容的
修改thinkphp框架下的 base.php
在 putenv("$name=$val"); 代碼下邊
加上
$_ENV[$name] = $val;
$_SERVER[$name] = $val;
這2句話即可
修改thinkphp框架下的 base.php
在 putenv("$name=$val"); 代碼下邊
加上
$_ENV[$name] = $val;
$_SERVER[$name] = $val;
這2句話即可
2019-03-31
TP5.1
$data = ['name' => 'thinkphp', 'status' => '1'];
return json($data);
$data = ['name' => 'thinkphp', 'status' => '1'];
return json($data);