Mechanomorph Mechanomorph - 2 years ago 81
PHP Question

Is there a faster/better way to check if an URL is reachable than cURL?

I'm building a PHP-script that checks if an URL is reachable. This is currently achieved with cURL. This is script is part of a bigger application that calls this cURL-Script very often .

So I am wondering if there is a faster/better way than cURL. So far i couldnt find anything except this article from this question: What is faster than curl?

This doesn't help me since I have the following requirements for the check:

  • Must follow redirects

  • Must return a HTTP-status-code (like 200 or

  • Must be able to authenticate (htaccess)


  • Must work in PHP safemode

Mjh Mjh
Answer Source

As per comment, the cause of slowness isn't the cURL library. There's a whole system behind HTTP, such as DNS, web server(s), the connectivity to those servers and ultimately - every site / service uses some sort of server-side language to perform work, which can be slow as well. You need to find out what exactly in this chain isn't responding fast enough - is it DNS? Is it the connection of your server to the service you're connecting to? Is the service itself slow?

You can be 100% sure that it's not cURL.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download