Thinkphp5.0.24新建admin/controller/User.php后可以訪問(wèn)這個(gè)控制器可以訪問(wèn)localhost/User/index
2019-05-01
use think\Config;為什么不能用,
the import think\Config cannnot be resolved
類(lèi)在think的libary下面能夠找到。
helper.php中也有,
但是這句就是報(bào)錯(cuò),
版本是5.0.24
think輸入提示中只有composer,任意其他類(lèi)都有錯(cuò)。
the import think\Config cannnot be resolved
類(lèi)在think的libary下面能夠找到。
helper.php中也有,
但是這句就是報(bào)錯(cuò),
版本是5.0.24
think輸入提示中只有composer,任意其他類(lèi)都有錯(cuò)。
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
沒(méi)顯示系統(tǒng)環(huán)境變量的
打開(kāi)php.ini,找到這樣幾行代碼:
; variables_order
;Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS"
然后,將;Default Value: "EGPCS"前面的分號(hào)去掉,整個(gè)配置變成:
; variables_order
Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS"
然后重啟Apache就可以了。
打開(kāi)php.ini,找到這樣幾行代碼:
; variables_order
;Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS"
然后,將;Default Value: "EGPCS"前面的分號(hào)去掉,整個(gè)配置變成:
; variables_order
Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS"
然后重啟Apache就可以了。
2019-03-31
沒(méi)顯示.env加載文件內(nèi)容的
修改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);
2019-03-20
TP5.1已經(jīng)獨(dú)立了config應(yīng)用配置出來(lái),不需要這樣自己創(chuàng)建了吧?
2019-03-19