From bob at patin.com Fri Oct 30 08:14:03 2015 From: bob at patin.com (Bob Patin) Date: Fri Oct 30 08:14:16 2015 Subject: [FX.php List] How to get past an FX query that fails Message-ID: <56655DD9-0EC9-4FDE-A75B-CCAF301AF8F9@patin.com> I have a test page that tests all of my FileMaker server web publishing engines; the one thing that I don?t know how to do though, is to have the page skip over a query if that particular WPE doesn?t respond. I have a little test to see if a server is up, but as most of you know, if the WPE isn?t running or if the server isn?t up, the page will just crap out on a query that has nothing from which to pull. Any ideas would be most appreciated; thanks, Bob Patin Longterm Solutions bob@longtermsolutions.com 615-333-6858 FileMaker 9, 10, 11, 12 & 13 Certified Developer http://www.longtermsolutions.com - iChat: bobpatin@me.com Twitter: bobpatin ? FileMaker Consulting FileMaker Hosting for all versions of FileMaker PHP ? Full email services ? Free DNS hosting ? Colocation ? Consulting -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20151030/bce8b27d/attachment.html From fxphp at igsmasouth.org Fri Oct 30 13:49:02 2015 From: fxphp at igsmasouth.org (Jon Montgomery) Date: Fri Oct 30 13:49:14 2015 Subject: [FX.php List] Help with error message Message-ID: <4CA4E235-AC44-4D81-A7AE-A6080A0C1832@igsmasouth.org> Hi, I am getting this error message and I have no idea how to fix it. Your help would be very much welcomed: Fatal error: Cannot use object of type FX_Error as array in /Library/WebServer/Documents/IGSMA/test/login_response.php on line 14 a few days ago working with Bob Patin at Longtermsolutions, who has hosted our FM7 (version 10) databases for many years, helped me with this and we were unable to get it to work on my laptop. So he loaded it up on one of his FM servers and it all works great. Now, on my MacBook Pro, (Mavericks, FMS14 and FX.PHP) I cannot get this to work. I have done various un-installs and re-installs of FMS14 and also PHP. PHP is running, however I am getting this error. Anybody have a clue what I have done to my machine that is causing this? For the record, work for years with FMStudio and know it?s downfall and am converting to straight ?roll your own? FX.PHP. But it all worked with FM version 10. Here is the code and the offending ?Line 14" is marked. SetDBData('IGSMA_Membership.fmp12','login'); $q->SetDBPassword($webPW,$webUN); $q->AddDBParam('Login_ID',$Login_ID); $q->AddDBParam('Password',$PW); $qResult = $q->FMFind(); echo $qResult[?errorCode?]; //this is the line referred to in the error message in Chrome Jon Montgomery, Illinois Grade School Music Assoicaiton - Southern Division www.igsmasouth.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20151030/bef6494f/attachment.html From ted-fitzgerald at uiowa.edu Fri Oct 30 21:13:05 2015 From: ted-fitzgerald at uiowa.edu (Fitzgerald, Theodore C) Date: Fri Oct 30 21:13:15 2015 Subject: [FX.php List] Help with error message In-Reply-To: <4CA4E235-AC44-4D81-A7AE-A6080A0C1832@igsmasouth.org> References: <4CA4E235-AC44-4D81-A7AE-A6080A0C1832@igsmasouth.org> Message-ID: Jon, Maybe you've already tried this, but I would suggest dumping out the contents of $qResult using var_dump($qResult); to see what type of object it is (the error message seems to indicate it's an FX_Error object) and what data it is holding. That will hopefully give you a bit more information about what is going on. Ted From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Jon Montgomery Sent: Friday, October 30, 2015 2:49 PM To: fx.php_list@mail.iviking.org Subject: [FX.php List] Help with error message Hi, I am getting this error message and I have no idea how to fix it. Your help would be very much welcomed: Fatal error: Cannot use object of type FX_Error as array in /Library/WebServer/Documents/IGSMA/test/login_response.php on line 14 a few days ago working with Bob Patin at Longtermsolutions, who has hosted our FM7 (version 10) databases for many years, helped me with this and we were unable to get it to work on my laptop. So he loaded it up on one of his FM servers and it all works great. Now, on my MacBook Pro, (Mavericks, FMS14 and FX.PHP) I cannot get this to work. I have done various un-installs and re-installs of FMS14 and also PHP. PHP is running, however I am getting this error. Anybody have a clue what I have done to my machine that is causing this? For the record, work for years with FMStudio and know it's downfall and am converting to straight "roll your own" FX.PHP. But it all worked with FM version 10. Here is the code and the offending "Line 14" is marked. SetDBData('IGSMA_Membership.fmp12','login'); $q->SetDBPassword($webPW,$webUN); $q->AddDBParam('Login_ID',$Login_ID); $q->AddDBParam('Password',$PW); $qResult = $q->FMFind(); echo $qResult['errorCode']; //this is the line referred to in the error message in Chrome Jon Montgomery, Illinois Grade School Music Assoicaiton - Southern Division www.igsmasouth.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20151031/3325e94b/attachment.html From fxphp at igsmasouth.org Sat Oct 31 14:20:19 2015 From: fxphp at igsmasouth.org (Jon Montgomery) Date: Sat Oct 31 14:23:12 2015 Subject: [FX.php List] Help with error message In-Reply-To: References: <4CA4E235-AC44-4D81-A7AE-A6080A0C1832@igsmasouth.org> Message-ID: <23B6C669-EB4A-46A7-84B3-75025D7B8D59@igsmasouth.org> Ted, Thank you for the tip. I have read about the var_dump() but did not know why you would use it. Here is what it said: Accessing FileMaker Server 7+ data. Using FileMaker URL: http://127.0.0.1:80/fmi/xml/FMPXMLRESULT.xml?-db=IGSMA_Membership.fmp12&-lay=login&-max=50&Login_ID=5501.1&Password=music4u&-find string(8) "$qResult? I also turned on DEBUG to get the url but it yields this: Not Found The requested URL /fmi/xml/FMPXMLRESULT.xml was not found on this server. So what does this tell us? Jon Montgomery, Illinois Grade School Music Assoicaiton - Southern Division www.igsmasouth.org On Oct 30, 2015, at 10:13 PM, Fitzgerald, Theodore C wrote: > Jon, > > Maybe you?ve already tried this, but I would suggest dumping out the contents of $qResult using var_dump($qResult); to see what type of object it is (the error message seems to indicate it?s an FX_Error object) and what data it is holding. That will hopefully give you a bit more information about what is going on. > > Ted > > From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org] On Behalf Of Jon Montgomery > Sent: Friday, October 30, 2015 2:49 PM > To: fx.php_list@mail.iviking.org > Subject: [FX.php List] Help with error message > > Hi, > > I am getting this error message and I have no idea how to fix it. Your help would be very much welcomed: > > Fatal error: Cannot use object of type FX_Error as array in /Library/WebServer/Documents/IGSMA/test/login_response.php on line 14 > > a few days ago working with Bob Patin at Longtermsolutions, who has hosted our FM7 (version 10) databases for many years, helped me with this and we were unable to get it to work on my laptop. So he loaded it up on one of his FM servers and it all works great. > > Now, on my MacBook Pro, (Mavericks, FMS14 and FX.PHP) I cannot get this to work. I have done various un-installs and re-installs of FMS14 and also PHP. PHP is running, however I am getting this error. > > Anybody have a clue what I have done to my machine that is causing this? For the record, work for years with FMStudio and know it?s downfall and am converting to straight ?roll your own? FX.PHP. But it all worked with FM version 10. > > Here is the code and the offending ?Line 14" is marked. > > include_once('FX/FX.php'); > include_once('FX/server_data.php'); > > $Login_ID = $_POST['Login_ID']; > $PW = $_POST['Password']; > > $q =new FX($serverIP,$webCompanionPort, $dataSourceType, $scheme); > $q->SetDBData('IGSMA_Membership.fmp12','login'); > $q->SetDBPassword($webPW,$webUN); > $q->AddDBParam('Login_ID',$Login_ID); > $q->AddDBParam('Password',$PW); > $qResult = $q->FMFind(); > echo $qResult[?errorCode?]; //this is the line referred to in the error message in Chrome > > > > Jon Montgomery, Illinois Grade School Music Assoicaiton - Southern Division > www.igsmasouth.org > _______________________________________________ > FX.php_List mailing list > FX.php_List@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/20151031/01cf12f6/attachment-0001.html From chris at iViking.org Sat Oct 31 21:26:08 2015 From: chris at iViking.org (Chris Hansen) Date: Sat Oct 31 21:21:55 2015 Subject: [FX.php List] Help with error message In-Reply-To: <23B6C669-EB4A-46A7-84B3-75025D7B8D59@igsmasouth.org> References: <4CA4E235-AC44-4D81-A7AE-A6080A0C1832@igsmasouth.org> <23B6C669-EB4A-46A7-84B3-75025D7B8D59@igsmasouth.org> Message-ID: <0F6FEDA5-D5C2-47D0-962C-336FA04FE17B@iViking.org> Hey Jon, Are you sure that XML sharing is enabled on FileMaker Server on your local machine? Basically, the URL that you see there is (semi) equivalent of the request being made to FileMaker. You should be able to click on that link and get back the XML that FileMaker outputs. For some reason, the connection to your locally running FileMaker isn't working, and that's the bit that you need to debug. At any rate, when you get an FX error object, it means that FX was never able to connect to the server for one reason or another. Something that even experienced developers tend not to do, that they should be doing, is trap for errors. So, that would look something like this: // the rest of your query code would be above this $qResult = $q->FMFind(); if (FX::isError($qResult)) { echo $qResult->getMessage(); } elseif ($qResult[?errorCode?] != 0) { echo "A FileMaker error occurred ({$qResult[?errorCode?]})"; } else { // your data set logic goes here } FYI, the curly braces inside the FileMaker error quotes help PHP to parse where the variable begins and ends. HTH --Chris > On Oct 31, 2015, at 2:20 PM, Jon Montgomery > wrote: > > Ted, > > Thank you for the tip. I have read about the var_dump() but did not know why you would use it. Here is what it said: > > Accessing FileMaker Server 7+ data. > > Using FileMaker URL: http://127.0.0.1:80/fmi/xml/FMPXMLRESULT.xml?-db=IGSMA_Membership.fmp12&-lay=login&-max=50&Login_ID=5501.1&Password=music4u&-find string(8) "$qResult? > > > I also turned on DEBUG to get the url but it yields this: > > Not Found > > The requested URL /fmi/xml/FMPXMLRESULT.xml was not found on this server. > > So what does this tell us? > > > > Jon Montgomery, Illinois Grade School Music Assoicaiton - Southern Division > www.igsmasouth.org > > > > On Oct 30, 2015, at 10:13 PM, Fitzgerald, Theodore C > wrote: > >> Jon, >> >> Maybe you?ve already tried this, but I would suggest dumping out the contents of $qResult using var_dump($qResult); to see what type of object it is (the error message seems to indicate it?s an FX_Error object) and what data it is holding. That will hopefully give you a bit more information about what is going on. >> >> Ted >> >> From: fx.php_list-bounces@mail.iviking.org [mailto:fx.php_list-bounces@mail.iviking.org ] On Behalf Of Jon Montgomery >> Sent: Friday, October 30, 2015 2:49 PM >> To: fx.php_list@mail.iviking.org >> Subject: [FX.php List] Help with error message >> >> Hi, >> >> I am getting this error message and I have no idea how to fix it. Your help would be very much welcomed: >> >> Fatal error: Cannot use object of type FX_Error as array in /Library/WebServer/Documents/IGSMA/test/login_response.php on line 14 >> >> a few days ago working with Bob Patin at Longtermsolutions, who has hosted our FM7 (version 10) databases for many years, helped me with this and we were unable to get it to work on my laptop. So he loaded it up on one of his FM servers and it all works great. >> >> Now, on my MacBook Pro, (Mavericks, FMS14 and FX.PHP) I cannot get this to work. I have done various un-installs and re-installs of FMS14 and also PHP. PHP is running, however I am getting this error. >> >> Anybody have a clue what I have done to my machine that is causing this? For the record, work for years with FMStudio and know it?s downfall and am converting to straight ?roll your own? FX.PHP. But it all worked with FM version 10. >> >> Here is the code and the offending ?Line 14" is marked. >> >> > include_once('FX/FX.php'); >> include_once('FX/server_data.php'); >> >> $Login_ID = $_POST['Login_ID']; >> $PW = $_POST['Password']; >> >> $q =new FX($serverIP,$webCompanionPort, $dataSourceType, $scheme); >> $q->SetDBData('IGSMA_Membership.fmp12','login'); >> $q->SetDBPassword($webPW,$webUN); >> $q->AddDBParam('Login_ID',$Login_ID); >> $q->AddDBParam('Password',$PW); >> $qResult = $q->FMFind(); >> echo $qResult[?errorCode?]; //this is the line referred to in the error message in Chrome >> >> >> >> Jon Montgomery, Illinois Grade School Music Assoicaiton - Southern Division >> www.igsmasouth.org _______________________________________________ >> FX.php_List mailing list >> FX.php_List@mail.iviking.org >> http://www.iviking.org/mailman/listinfo/fx.php_list > _______________________________________________ > FX.php_List mailing list > FX.php_List@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/20151031/8b664cd5/attachment.html From fxphp at igsmasouth.org Sat Oct 31 21:49:27 2015 From: fxphp at igsmasouth.org (Jon Montgomery) Date: Sat Oct 31 21:49:40 2015 Subject: [FX.php List] Help with error message In-Reply-To: <0F6FEDA5-D5C2-47D0-962C-336FA04FE17B@iViking.org> References: <4CA4E235-AC44-4D81-A7AE-A6080A0C1832@igsmasouth.org> <23B6C669-EB4A-46A7-84B3-75025D7B8D59@igsmasouth.org> <0F6FEDA5-D5C2-47D0-962C-336FA04FE17B@iViking.org> Message-ID: Hey Chris, Thanks for the info. I put the code in and this is what it yielded: FX: ExecuteQuery XML error: SYSTEM or PUBLIC, the URI is missing at line 1 Could this be a Filemaker Server 14 port conflict? When I installed (or deployed, I don?t remember) but got the message that ports 80 and 443 were in use click to disable those other applications using those ports (or something to that effect). I did. After that, the FMS tests all worked but I had no PHP (in phpinfo.php) running. Poked around in terminal and got Appache running and got PHP info page up. But then get these FX_Errors as in original post. Could my server set up be what is causing my problem since I cannot get any XML data from the link? Thanks! Jon On Oct 31, 2015, at 10:26 PM, Chris Hansen wrote: > Hey Jon, > > Are you sure that XML sharing is enabled on FileMaker Server on your local machine? Basically, the URL that you see there is (semi) equivalent of the request being made to FileMaker. You should be able to click on that link and get back the XML that FileMaker outputs. For some reason, the connection to your locally running FileMaker isn't working, and that's the bit that you need to debug. > > At any rate, when you get an FX error object, it means that FX was never able to connect to the server for one reason or another. Something that even experienced developers tend not to do, that they should be doing, is trap for errors. So, that would look something like this: > > // the rest of your query code would be above this > $qResult = $q->FMFind(); > if (FX::isError($qResult)) { > echo $qResult->getMessage(); > } > elseif ($qResult[?errorCode?] != 0) { > echo "A FileMaker error occurred ({$qResult[?errorCode?]})"; > } > else { > // your data set logic goes here > } > > FYI, the curly braces inside the FileMaker error quotes help PHP to parse where the variable begins and ends. > > HTH > > --Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20151031/865523df/attachment-0001.html