0

I am hosting a website on a webhost for a game. I wanted to test if my webhost could handle the ammount of requests my game would make. So I created a script that would send 500 requests per minute to my website.

It seemed to handle everything perfectly, but after a while de respondse would return ERROR_WINHTTP_INVALID_SERVER_RESPONSE. I googled it, and it ment that the server respondse could not be parsed.

PHP Code:

<?php
$json = file_get_contents("php://input");

$array = json_decode($json, true);

include "../MySQL/connect_to_mysql.php"; //Just an basic mysqli_connect()

$query = mysqli_query($link, "UPDATE playerData SET wins = wins + 1 WHERE PlayerID='".$array['playerID']."'");

echo mysqli_error($link);

mysqli_close($link);

echo $_SERVER['REMOTE_ADDR'];
exit();
?>

The in-game script just sends a HTPP PostAsync to this file, with an array which contains the playerID.

Is this an error in my php code or in my website configuration or in my code in my game? Also, how do I fix that error?

Joas
  • 11
  • 5
  • http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php – Matt Feb 21 '16 at 15:19
  • @mkaatman I don't think you quite understand the question, I am not trying to get php error messages. – Joas Feb 21 '16 at 15:24
  • There's nothing wrong with the code. It's something in the config. We can guess what it is but without some sort of error log that tells us something more specific our guess is as good as yours. My best guess is that your connect_to_mysql.php code is failing. – Matt Feb 21 '16 at 15:26
  • @mkaatman The problem is, I can not view the http respondse, so I can't view the php error, if there even is one. My connect_to_mysql code is : – Joas Feb 21 '16 at 15:30
  • @mkaatman Also in my error_log files are no php errors to be found. – Joas Feb 21 '16 at 15:35
  • Do any PHP scripts run at all? Can you run ` – Matt Feb 21 '16 at 15:37
  • @mkaatman I don't think you understand this question... Ofcourse my php scripts are running,: "but after a while de respondse would return ERROR_WINHTTP_INVALID_SERVER_RESPONSE.". This can be after 900-4000 perfectly executed PostAsyncs. Then the game-sided scripts throw the error. – Joas Feb 21 '16 at 15:46
  • So we know there's nothing wrong with the code, it must be a setting the host has enabled to throttle requests. Contact them and see. – Matt Feb 21 '16 at 15:47

0 Answers0