I have a script that checks responses from HTTP servers using the PEAR HTTP classes. However, I recently discovered that the script does not work on FTP servers (and probably nothing but HTTP or HTTPS). I tried Google but did not see any scripts or code that returned the server status code from servers other than HTTP servers.
How to find out the status of a newsgroup or FTP server using PHP?
EDIT: I should clarify that I'm only interested in being able to read from the FTP server and the directory that I specify. I need to know if the server is dead or not, I am not authorized to read, etc.
Please note that although in most cases I am agnostic in the language, the whole site is managed by PHP, so the PHP solution will be the best for ease of maintenance and extensibility in the future.
source
share