Re: [PHP] Checking if a host is online
Jason Giangrande wrote: I'm creating an application for an Intranet that, among other things, is supposed to check to see if particular hosts are online, and if so, what their IP address is. Anyone know how I can accomplish this? I tried using exec("host $host"); (where $host is the hostname) and while this gets the IP it gets the IP address sometimes even if the host is not active, because a DNS record for the system still exists. I also looked into the gethostbyname() function, but that has similar problems to using the external host command. I also tried to use an external ping command (ping -c 1 $host), and while I could get that to work, since it returns non-zero status if the host can not be contacted, it takes quite a while to execute for even a few hosts at once. Anyone ever do this king=d of thing before or have any suggestions on what might work? why not try: passthru("ping $host"); Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Checking if a host is online
Adam Maas wrote: Jason Giangrande wrote: I'm creating an application for an Intranet that, among other things, is supposed to check to see if particular hosts are online, and if so, what their IP address is. Anyone know how I can accomplish this? I tried using exec("host $host"); (where $host is the hostname) and while this gets the IP it gets the IP address sometimes even if the host is not active, because a DNS record for the system still exists. I also looked into the gethostbyname() function, but that has similar problems to using the external host command. I also tried to use an external ping command (ping -c 1 $host), and while I could get that to work, since it returns non-zero status if the host can not be contacted, it takes quite a while to execute for even a few hosts at once. Anyone ever do this king=d of thing before or have any suggestions on what might work? why not try: passthru("ping $host"); Adam My bad, didn't read closely enough. It's not likely to be able to do this fast, ef you only want it to query when asked. You may want to look into a monitoring solution like NOCOL. Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem compiling with openssl support
Jon Hill wrote: Hi I cannot manage to compile openssl support into php. my configuration line is CPPFLAGS='-I/usr/local/include/' ./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr --with-gettext-dir=/usr --with-gd --with-png-dir=/usr --with-zlib-dir=/usr --with-jpeg-dir=/usr --with-gd-native-ttf --enable-magic-quotes --enable-calendar --enable-ftp --enable-wddx --with-openssl=/usr configure always complains that it cannot find evp.h evp.h IS located in /usr/local/include/openssl I have tried a vairety of variations to try and get it to work. Perhaps I have not set CPPFLAGS properly or I need something else? hope someone can show me the way. Jon Your last flag is incorrect. --with-openssl needs to be /usr/local It's looking in /usr/include for evp.h Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php