php - CakePHP 2.6.2 - BasicAuthenticate - Call to undefined method UnauthorizedException::responseHeader() -


i use digest auth in cakephp app protect actions. on pc wamp works, when push on server have error:

fatal error

error: call undefined method unauthorizedexception::responseheader()

file: .../lib/cake/controller/component/auth/basicauthenticate.php

line: 104

/lib/cake/controller/component/auth/basicauthenticate.php:

public function unauthenticated(cakerequest $request, cakeresponse $response) {     $exception = new unauthorizedexception();     $exception->responseheader(array($this->loginheaders())); //line 104     throw $exception; } 

someone has idea problem ?

thanks help.

unauthorizedexception extends httpexception

httpexception has folowing bit of code (cake 2.5.6)

if (!class_exists('httpexception', false)) {     class httpexception extends cakebaseexception {     } } 

if have httpexception defined not extend cakebaseexception , wil not have responseheader function implemented

check php extensions , vendor libraries if have httpexception

i used:

$reflector = new reflectionclass('httpexception');         var_dump($reflector->getfilename()); //if defined in php file var_dump($reflector->getextensionname()); //if defined in php extension 

to find out have php-http extension installed dont need , has httpexception class defined


Comments