I become always 500 Error

You can use php -l filename.php to run the PHP linter which will highlight syntax errors like this. Also a 500 error means “server fluff up” so you should check your server error log for what happened.