I'm writing a PHP error collection widget that collects errors from an application and then by making a POST request to a URL, reports them.
How many different ways to do this are there, and how would you detect whether they are available? On different servers extensions may not be installed and security options may be turned off so I'd like to try as many as possible.
- CURL is one; what's the best way to check whether this is installed?
- fopen() can do URL's if it has permission but I don't think you can send POST data?
- http://uk3.php.net/manual/en/book.http.php looks like it needs curl, so we may as well just use curl.
- PHP sockets could be used, and just write the HTTP protocol yourself; any good libraries for this?
This service is open source under the BSD license BTW: http://elastik.sourceforge.net/