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

500 Internal Server Error

when I annotation this function my web is normal but when I logined then logout, and restart chrome its show 500 Internal Server Error? why?

>   following is my function:
> public function cookiesLogin(){
>         $salt = 'GYHZMFSWP';
>         $permanent  = $this->cookies->get('permanent')->getValue();
>         $identifier = $this->cookies->get('identifier')->getValue();
>        
>         $remember=RememberTokens::findFirstByIdentifier($identifier); //find data
> 
>         if($permanent == $remember->permanent){  //check cookie to login then setsession
>             if($identifier == md5($salt . md5($remember->getUser()->name .$salt))){
>                 if((time()-(86400*8))<$remember->createdAt){
>                     $user= Users::findFirstById($remember->userid );
>                     $this->regSessionAuth( $user );
>                     //reproduct cookie
>                     $this->rememberMe( $user );
>                     return true;
>                 }
>             }
>         }
> 
>         $this->cookies->get('permanent')->delete();
>         $this->cookies->get('identifier')->delete();
>         return false;
>     }
> 
> 


17.5k

If you look at your log, it will tell you what line is failing. Log into your server, go to /var/log/apache2/ and run tail -f yourlogoname and create the error. You'll get a message saying why it's broken.



27.0k

thanks I use nginx in centos7 but the log also doesnt tell why 500 error,



27.0k

I was update to php5.6 and phalcon 2.08 so as I cant read cookies value.



351
Accepted
answer

To get PHP error logging on when using Nginx with PHP-FPM you need may need to set catch_workers_output = yes in your pool configuration, on Debian and Ubuntu this would be /etc/php5/fpm/pool.d/www.conf by default.



27.0k

your are not the true answer, but I solve it by display errer in php and php-fpm, when dont display error nginx will show 500 error, then error tell me my cookie crypt must be in 16 24 and 32 long charater