[FX.php List] Catch FileMaker Server before it dies?

Steven Thoms sthoms at wavecomm.com
Thu May 24 16:23:30 MDT 2012


This is a bit more than you are probably looking for, but...
I do this: (substantially simplified)

$strError = '';
$resultError = 0;
$query =  new FX(FM_IP, FM_PORT, FM_VERSION, SCHEME);
$query -> SetDBData($file);
$query -> SetDBUserPass(FM_USERNAME, FM_PASSWORD);
$result = $query -> FMDBNames();
//print_r($query);
if ( $query->lastErrorCode != 0 ) {
     AddError("The database is not available.<br />The Web Publishing  
Engine is not responding. ErrorCode:" . $query->lastErrorCode ,  
$strError);
} else {
     $searchDbs  = explode("," , REQUIRED_DBS);
     $dataString = serialize($result['data']);
     foreach ( $searchDbs as $key=>$dbName ) {
         if ( strpos($dataString , $dbName) === false ) {
             $newError = "The " .  $dbName . " database was not  
available.".$dataString;
             AddError($newError , $strError);
         }
     }
}
if ( $strError != '' ) {
     include_once "{$AppLoc}src/error.php";exit;
}

This ensures not only that the wpe is responding but that the dbs  
needed are there. I found FMDBNames() gives the quickest response.


Steve


On May 24, 2012, at 3:26 PM, Denis Somar wrote:

> Hi all,
>
> I'm about to go into beta testing with my first production-worthy  
> FMP web project.  I'm not sure of the load to expect (nothing huge  
> initially) in terms of users, but I'm wondering if I can catch catch  
> automatically when the site is under a heavy load so I know that it  
> happens.  Are there any PHP calls that can be used to die gracefully  
> (or not) and just say the database server isn't working/isn't  
> responding.
>
> The v11 database is going to be accessed via two FileMaker clients  
> (using a separated interface file) frequently AND also some number  
> of web users.  Thus I'm unsure of how to measure / determine when FM  
> will break under the pressure of requests.  The server is hosted at  
> triple8.net so I don't know how much I can install in terms of admin  
> tools.
>
> TIA,
> Denis
> _______________________________________________
> 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