If you want a return message from AJAX:"Request URL" your php script should generate some output, like:
echo "done";
or if you want return the number of bytes that were written to the file:
$bytes = file_put_contents("data.txt", $_GET['myVar']);
if($bytes !== false){ echo $bytes; }else{ echo "failed"; }
I suspect your error messages are based on incorrect web-server settings.