Wednesday, November 5, 2008

URL checker works using PHP 5 and CURL API for PHP. It checks for URL's existence in four scenarios.

URL can be available with a web site in it properly, URL can be available but the site is under Quarantine, URL available but the site has been moved or the virtual directory is not there or domain not available or the URL is working but some Server error occured on the site (HTTP Error Code 500)

First Version of the URL Checker used PHP Socket API for checking. Since PHP Socket uses DNS Resolving before making a Socket Connection, it takes large amount of time when it comes to large set of URL's. The second version uses CURL with Asynchronous Ajax calls to the server. Since the weight of an Ajax call is very little this script runs faster than the previous one. According to my observation it only take 10 to 15 seconds to check 600 URL's. Therefore CURL is preferred as a more rapid way to check URL existence.