Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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;
>     }
> 
> 


12.0k

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.



16.3k

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



16.3k

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.



16.3k

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