An error 500 usually means that the PHP has crashed. This is most often due to an error in the code. But with code you’ve got from elsewhere it could be that its designed for an old PHP version that’s not compatible, or that its calling a blocked function thats blocked here.
You can turn on full PHP errors in your dashboard for more information on the error. and this article from admin can help too