Jump to content

PHP Script to Ping an IP Address


noumanyasin

Recommended Posts

PHP doesn't have a way to create pings - unless you want to craft the packets yourself.

 

Quick answer: make a script that runs Windows' ping with its usual 4 attempts, parses the output to see how many were returned, and uses sc

sc start 
to start the service if necessary.
Link to comment
Share on other sites

I want o write a script in php to ping an IP address. Scenario is that If ping fails, it should run a window service on the same system. ping must repeat 3-4 times every 30 second. Please help me in this problem. Thanks 

Interested in what your attempting to achieve?  Are you trying to get some form of failover, if so there are some more tried and reliable methods out there.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.