[FX.php List] Checking the server is available before calling FX

David Ness dness at bondedbuilders.com
Tue Mar 11 12:56:10 MDT 2008


That might have been me:

BTW, in talking about failover servers, I've set up my fx.php code with
the following logic:


// Check to see if the FileMaker server is up and running
if( !fsockopen ($FMserverIP, 80, $errno, $errstr, 2) )	{
	// set the variable used in fx.php calls to the redundant server
IP
	$FMserverIP = $failoverFMServerIP; 
	// No, it appears to be down, so test the failover server
	if( !fsockopen ($FMserverIP, 80, $errno, $errstr, 2) )	{
		$serverUp = false;
	} else {
		$serverUp = true;
	}
} else {
	$serverUp = true;
}

Before attempting to display a page, I test the value of $serverUp and
display an error page if the servers, both Primary & Failover, are down.


-----Original Message-----
...
In the event of a failure, the system switches to the redundant
Location...


 
David Allen Ness
Database Systems Programmer
Web Applications Developer
 
 
-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Glenn
Singleton
Sent: Tuesday, March 11, 2008 2:31 PM
To: FX.php Discussion List
Subject: [FX.php List] Checking the server is available before calling
FX

Hi,

In a thread I cannot find, someone showed some PHP code that tested that
the 
connection to the server was available before calling any FX.PHP
functions. 
Can anyone repost this code if they have it ?

As I recall, it was testing to see if the server was running and if not 
using the backup server. Again, I think it was by using basic PHP file 
functions.

I am having trouble with a sometimes unreliable link between web server
and 
fm server and would like to use this method before calls to FX.PHP

I am using the recommended testing after calling a FX.PHP object (ie if 
(FX::isError($searchResult)) ) but this is still throwing a PHP error of

'FX.PHP object not found' ***IF*** the server is not available.

Thanks
Glenn Singleton

_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list


More information about the FX.php_List mailing list