[FX.php List] Checking the server is available before calling FX
Glenn Singleton
glenn at possiblesolutions.com.au
Tue Mar 11 12:52:47 MDT 2008
David,
Thank you very much, for sharing your code and the promptness of your reply.
It will help my situation greatly.
Regards
Glenn Singleton
----- Original Message -----
From: "David Ness" <dness at bondedbuilders.com>
To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
Sent: Wednesday, March 12, 2008 5:56 AM
Subject: RE: [FX.php List] Checking the server is available before calling
FX
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
_______________________________________________
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