News Feed
Jobs Feed
Sections




News Archive
DeveloperTutorials.com:
Port Scanning and Service Status Checking in PHP
April 08, 2009 @ 08:49:21

On the DeveloperTutorials.com site today there's a new tutorial showing the creation of a port scanner with PHP - a tool that, given some of the familiar ports that services (like web or email servers) run on, can check to see if they're responding.

While building web applications, it's often important to keep an eye on the other services running on your server. Having access to the current status of public servers can empower your applications to make decisions and respond to problems automatically. Acknowledging a service is offline can also save endless support emails. In this tutorial, I'll show you how to keep track of your server status by scanning ports on your server with PHP.

Their example makes a socket connection to the remote port to see if there's a valid hookup. The wrap this inside a loop for ports 1 through 1000 to see what ports are open and responding on your local machine (doing this on a remote machine is just asking for trouble).

Their full example defines some of the common ports in an array and loops to check on their status. It sets out a base you can build on top of with things like their suggestions - logging scan results, repoting downtime and running a service-specific task.

0 comments voice your opinion now!
port scan fsockopen socket http ftp pop3 check connection


blog comments powered by Disqus

Similar Posts

Matthew Turland's Blog: Benchmarking PHP HTTP Clients

Hari KT: Aura.Http : Request and Response

David Coallier's Blog: Zend Framework Without PDO

Harry Roberts' Blog: Manipulating PHP arrays with SQL

Design Aeon: Check Dead Links From Database Using PHP CURL


Community Events











Don't see your event here?
Let us know!


application phpunit testing community series conference opinion development example tool release introduction podcast functional zendframework2 interview code language unittest framework

All content copyright, 2013 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework