1
While updating files from my vendor folder on the server I had the following errors:
Fatal error: Call to Undefined method Cake View Widget Selectboxwidget::outputError() in /var/www/vhosts/domain.com.br/vendor/cakephp/cakephp/src/Error/Errorhandler.php on line 118
Notice: Undefined Property: Cake View Widget Selectboxwidget::$_outputFormat in /var/www/vhosts/domain.com.br/vendor/cakephp/cakephp/src/Error/Debugger.php on line 302
Fatal error: Cannot access protected Property Cake View Widget Selectboxwidget::$_templates in /var/www/vhosts/domain.com.br/vendor/cakephp/cakephp/src/Error/Debugger.php on line 352
I can’t explain the reason for the error, but local everything is functioning normally. I tested in two environments: Docker linux running on Ubuntu and xampp running on windows, both worked, only on the server that appears this error.
[UPDATE] I tested the same code on other servers (a hostgator and a kinghost), in both worked normally.
[UPDATE 2] Error:
2017-07-10 12:29:00 Warning: Warning (2): transliterator_transliterate():
Could not create transliterator with ID "Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove" (transliterator_create: unable to open ICU transliterator with id "Any-Latin; Latin-ASCII; [\u0080-\u7fff] remove": U_INVALID_ID) in [/var/www/vhosts/MEU_DOMINIO.com.br/MEU_SITE.com.br/vendor/cakephp/cakephp/src/Utility/Text.php, line 1070]
Request URL: /
Client IP: MEU_IP
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE/src/Error/BaseErrorHandler.php, line 153
transliterator_transliterate - [internal], line ??
Cake\Utility\Text::transliterate() - CORE/src/Utility/Text.php, line 1070
Cake\Utility\Text::slug() - CORE/src/Utility/Text.php, line 1103
Cake\View\Helper\FormHelper::_domId() - CORE/src/View/Helper/IdGeneratorTrait.php, line 82
Cake\View\Helper\FormHelper::control() - CORE/src/View/Helper/FormHelper.php, line 1084
Cake\View\Helper\FormHelper::input() - CORE/src/View/Helper/FormHelper.php, line 1165
include - APP/Template/Pages/home.ctp, line 19
Cake\View\View::_evaluate() - CORE/src/View/View.php, line 1025
Cake\View\View::_render() - CORE/src/View/View.php, line 986
Cake\View\View::render() - CORE/src/View/View.php, line 610
Cake\Controller\Controller::render() - CORE/src/Controller/Controller.php, line 623
App\Controller\PagesController::display() - APP/Controller/PagesController.php, line 101
Cake\Controller\Controller::invokeAction() - CORE/src/Controller/Controller.php, line 440
Cake\Http\ActionDispatcher::_invoke() - CORE/src/Http/ActionDispatcher.php, line 119
Cake\Http\ActionDispatcher::dispatch() - CORE/src/Http/ActionDispatcher.php, line 93
Cake\Http\BaseApplication::__invoke() - CORE/src/Http/BaseApplication.php, line 78
Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65
Cake\Routing\Middleware\RoutingMiddleware::__invoke() - CORE/src/Routing/Middleware/RoutingMiddleware.php, line 59
Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65
Cake\Routing\Middleware\AssetMiddleware::__invoke() - CORE/src/Routing/Middleware/AssetMiddleware.php, line 88
Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65
Cake\Error\Middleware\ErrorHandlerMiddleware::__invoke() - CORE/src/Error/Middleware/ErrorHandlerMiddleware.php, line 92
Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65
DebugKit\Middleware\DebugKitMiddleware::__invoke() - ROOT/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php, line 52
Cake\Http\Runner::__invoke() - CORE/src/Http/Runner.php, line 65
Cake\Http\Runner::run() - CORE/src/Http/Runner.php, line 51
Cake\Http\Server::run() - CORE/src/Http/Server.php, line 80
[main] - ROOT/webroot/index.php, line 37
Function with indication
public function display()
{
$this->set('title', 'Home');
$this->viewBuilder()->layout('extern');
$undertakings = $this->loadModel('Undertakings');
$developers = $this->loadModel('Developers');
$abouts = $this->loadModel('Abouts');
$undertaking = $this->Undertakings->find('all', [
'limit' => 3,
'contain' => ['Pictures', 'Cities'],
'order' => 'rand()',
'conditions' => [
'status' => 'A',
'Undertakings.id IN' => [27, 18, 76]
]
]);
$about = $this->Abouts->get(1);
$developer = $this->Developers->find('all', [
'contain' => ['Pictures'],
'order' => 'rand()',
'conditions' => [
'Developers.id >' => 1
]
]);
$this->set(compact('undertaking', 'about', 'developer'));
$path = func_get_args();
$count = count($path);
if (!$count) {
return $this->redirect('/');
}
if (in_array('..', $path, true) || in_array('.', $path, true)) {
throw new ForbiddenException();
}
if (!empty($path[0])) {
$page = $path[0];
}
if (!empty($path[1])) {
$subpage = $path[1];
}
//AQUI O ERRO É INDICADO (LINHA 101)
try {
$this->render(implode('/', $path));
} catch (MissingTemplateException $e) {
if (Configure::read('debug')) {
throw $e;
}
throw new NotFoundException();
}
}
Lucas, you need to post the contents of the Errorhandler.php file for debugging what happens. Your question became too superficial because it does not allow debugging of error. By the message he is informing that he could not locate the method within the class called outputError().
– Rafael Salomão
@Rafaelsalomão, I added the information requested to the question.
– Lucas Thibau Paulino
Try to solve fatal errors in order that occur, 1º Check in the class installed on the server if the class
Cake\View\Widget\SelectBoxWidget
is being imported correctly and if in fact it has the outputError method inside the respective file (or in its relatives if it specifies another class). On the others, I’m seeing programming errors such as trying to access protected or private attributes of a class directly, but I can’t be sure if they are not occurring due to the first error.– LeonanCarvalho
@Leonancarvalho, as I said, tested on other servers the same code and everything works normally. I have exactly the same content (I literally downloaded it from the repository and went straight up) to 3 web servers and 2 locations. Only in this environment does it not work. Most of the errors indicated are a pointer to the functions of the framework. The only point I have errors indicated in my code, I have even tried to remove the snippet and the error remains. Hence the certainty of being a problem on the server.
– Lucas Thibau Paulino
Is the php version exactly the same? You still have all the necessary extensions installed?
– LeonanCarvalho
@Leonancarvalho, I put the identical version and also later and earlier versions. Any version above the 5.6 works normally. The framework itself has handled less than indicating the php version error before this error.
– Lucas Thibau Paulino
This really seems to me something of an environment (modules, extensions, OS) Take a look at this question: https://stackoverflow.com/q/42955218/3706998
– LeonanCarvalho
Thank you very much @Leonancarvalho! I passed to the staff of the server. I will wait return.
– Lucas Thibau Paulino
Good @Leonancarvalho, the staff of the server ended up giving up and reset the configuration from scratch. This one was in limbo... =/
– Lucas Thibau Paulino
I believe that question should be closed then.
– LeonanCarvalho