We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Internal Server Error when adding validators

Hi. I've encountered a strange problem with Validation. I'm working on a REST API and for validating posted data I use phalcon validators. but the problem is whenever I add a validator to my validation instance I get internal server error. trying and catching exceptions did not help. no exception is throwed.


$validation = new Validation();
$validation->add('title', new StringLength([
        'max'=> 255,
        'messageMaximum' => $this->t('Maximum number of characters for title is 255'),
]));

in the above example right at the add method an internal server error is occuring. no line after that is interpreted. The strange part is that my collegues have no problem with it and the exact same code works for them. they are using windows and im working with ubuntu 14.04. at first i though the problem is with my version of php. but after updating it from 5.5.9 to 5.6 nothing has changed and the problem is still persistent.

I would appreciate any suggestion.



3.5k
Accepted
answer

Hello! If you cann't catching exception in php i think problem is in web-server. Check web-server's log.

Hello! If you cann't catching exception in php i think problem is in web-server. Check web-server's log.

Thank you very much. I checked apache error logs. due to that log there was a fatal error wich was caused because a file path mentioned in the config could not be found. the path was started by capital letter in contrary to the actual path and linux is case-sensitive.