500 hatası da kod hatasıdır, kod çalışırken aksi bir durum oluşunca bu hata çıkar. hostingde mi test yapıyorsun yoksa bilgisayarında (localhost) mı?