0
我有一個CakePHP網站,它的佈局中使用了FULL_BASE_URL
常數。我注意到,象這樣的錯誤顯示在我的「的debug.log」文件了:HEAD導致「使用未定義的常量FULL_BASE_URL」通知
2013-12-18 16:25:04 Notice: Notice (8): Use of undefined constant FULL_BASE_URL - assumed 'FULL_BASE_URL' in [/var/www/example.com/app/View/Layouts/default-app.ctp, line 11]
Trace:
include - APP/View/Layouts/default-app.ctp, line 11
View::_evaluate() - APP/Lib/cakephp/lib/Cake/View/View.php, line 945
View::_render() - APP/Lib/cakephp/lib/Cake/View/View.php, line 907
View::renderLayout() - APP/Lib/cakephp/lib/Cake/View/View.php, line 535
View::render() - APP/Lib/cakephp/lib/Cake/View/View.php, line 479
Controller::render() - APP/Lib/cakephp/lib/Cake/Controller/Controller.php, line 948
PagesController::display() - APP/Controller/PagesController.php, line 105
ReflectionMethod::invokeArgs() - [internal], line ??
Controller::invokeAction() - APP/Lib/cakephp/lib/Cake/Controller/Controller.php, line 486
Dispatcher::_invoke() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 187
Dispatcher::dispatch() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 162
[main] - APP/webroot/index.php, line 114
望着Apache的訪問日誌,我看到它是由這個原因引起:
198.252.206.16 - - [18/Dec/2013:16:25:02 -0700] "HEAD/HTTP/1.0" 200 317 "-" "-"
的唯一途徑我已經能夠重現這是通過使用Telnet,像這樣:
telnet example.com 80
HEAD/HTTP/1.0
[push enter again]
可能是什麼造成的?這是與我的PHP配置或我的Apache配置或其他東西?
CakePHP版本? – Anubhav
@Anubhav 2.4.0測試版。是的,我知道,這是一個測試版。我打算在某個時候升級。不過,我確信升級不會解決問題。升級完成後,我可以回報。 – Nick
FULL_BASE_URL從版本2.4開始棄用:此常量已棄用,您應該使用Router :: fullbaseUrl()來代替。 – Anubhav