Reputation: 1
I want to check the connectivity of remote servers without using the ping command on my server. The reason for avoiding ping(8) is the potential security risks, such as command injection vulnerabilities when using exec()
.
Additionally, I want to implement this connectivity check asynchronously using AJAX so that the status updates periodically on the frontend without reloading the page.
I initially used
exec("ping -c 2 " . escapeshellarg($ip))
in PHP, but I realized it could pose a security risk.
I also considered using fsockopen()
, but I am unsure if it is the best solution.
My goal is to find a safe and reliable way to check server availability and update the status dynamically via AJAX requests to my PHP scripts in my Laravel application.
Upvotes: -1
Views: 45