[FX.php List] Catching a FM11 DB nonresponsive
Tim 'Webko' Booth
tim.webko at gmail.com
Wed Jul 31 18:39:45 MDT 2013
I'd run a simple check to see if anything is available, and redirect based
on that.
My server test file looks like:
<?php
// include_once('db_config.php'); // DataBase Configuration File -
not used for initial testing
// Insert valid hostname, user, password, database name and layout in the
database (lines 5, 9, 10, 11 & 12)
$dbHost='XXXXXXXX'; //Database IP
$port='80'; //Webserver Port
$dbType='FMPro7'; //For FMPro7, also works for 12
$conType='HTTP'; //Connection Type
$dbUser='USER'; //Database User Name
$dbPass='PASS'; //Database Password
$dbName='DATABASE'; //Database Name
$layout = 'LAYOUT'; //Valid layout name
include_once('include/FX/FX.php'); // FX.php file
//Simple server tests
$_SESSION['serverError'] = ""; // reset server error
//Check if Port 80 works at all
if( !fsockopen ($dbHost, 80, $errno, $errstr, 2) ) {
$_SESSION['serverError'] = "Server not up";
} else {
//Check if a findany to an available table works
$pageObj=new FX($dbHost,$port,$dbType,$conType);
$pageObj -> setDBPassword($dbPass,$dbUser);
$pageObj -> setDBData($dbName, $layout, 'all');
$pageData = $pageObj -> FMFindAny();
$_SESSION['serverError'] = $pageData['errorCode'];
}
if ($_SESSION['serverError'] != "0") {
echo "Error: ".$_SESSION['serverError'];
}
?>
On 1 August 2013 09:39, Denis Somar <dsomar at gmail.com> wrote:
> I believe the WPE
>
> On Jul 31, 2013, at 6:04 PM, Dale Bengston <dale.bengston at gmail.com>
> wrote:
>
> > Hi Denis,
> >
> > Is the Web Publishing Engine going down, or FileMaker Server?
> >
> > Dale
> >
> > On Jul 31, 2013, at 5:27 PM, Denis Somar <dsomar at gmail.com> wrote:
> >
> >> I keep having my FM 11 DB server host go down and want to catch the
> >> error before doing all the PHP of my app, whats the best way to handle
> >> that error exception? Anyone have any code samples?
> >> _______________________________________________
> >> 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
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20130801/8736d7a3/attachment.html
More information about the FX.php_List
mailing list