V
V
Vladimir2019-03-05 00:02:43
PHP
Vladimir, 2019-03-05 00:02:43

How to write protection against a large number of requests to the site from one IP in php?

Please tell me how can I check the IP if it makes 100500 requests per second and issue die () at the beginning of the page in php to protect against bulk requests and mini ddos ​​attacks? I am new to security matters. Help to get rid of hacking attempts.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Antony Tkachenko, 2019-03-05
@LemonFox

The easiest way to do this is by means of a web server.
Example for nginx
https://www.nginx.com/blog/rate-limiting-nginx

A
Anatoly, 2019-03-09
@Tolly

If IP makes 100500 requests per second, then you can't check, the checker will die.
It's better to use tools specifically designed for this, for example:
iptables, fail2ban,..
On php or nginx, you can make protection from F5 ))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question