Sign in to follow this  
Followers 0

FMS13 upgrade breaks FX.PHP query

6 posts in this topic

My client recently upgraded their FileMaker Server, an xServe, to OS X 10.9 and FMS13. As a result, an existing php web site, pulling FileMaker data using fx.php, is now broken.


I perform a simple query, looking up a user by their account name. After the upgrade, I am returned 0 records with an error of '4'. The weird part is, when I run my script with debug on, and I manually click on the resulting query URL it works as I would expect. The XML result is the one record I asked for.


I can't seem to find other forum posts, from others who have had this issue after upgrading to FMS13. Is anyone aware of any differences in FMS13 which might cause this failure? any thought or suggestions are welcome. Thanks


Dave W


---- Here's the query ------------------


$_SESSION['account_name'] = $_REQUEST['account_name'];
//define("DEBUG", true);
// === required FX files
require_once(/*$_SERVER['DOCUMENT_ROOT'] . */"FX/FX.php");
require_once(/*$_SERVER['DOCUMENT_ROOT'] . */"FX/FX_Error.php");
require_once(/*$_SERVER['DOCUMENT_ROOT'] . */"FX/Developer/FMErrors.php");
require_once(/*$_SERVER['DOCUMENT_ROOT'] . */"FX/server_data.php");
$database = 'MyFile.fmp12';
$layout = 'web_login';
$login= new FX($serverIP, $webCompanionPort, $dataSourceType, $scheme);
$login->SetDBData($database, $layout);
$login->SetDBPassword($webPW, $webUN);
$login->AddDBParam('login_name',$_SESSION['account_name'] );
$loginresult = $login->FMFind();
$resultcount = $loginresult['foundCount'];
$resultdata  = $loginresult['data'];
echo $resultcount.' count<br>';
echo $loginresult['errorCode'].' error';
------------ End of the query -------------------
--------------Here's the result ------------------

Share this post

Link to post
Share on other sites

I am experiencing the same issue.  Does anyone have any input on what and how to fix the issue?


Here is my function call


function get_special_FM($debug = false) {
    $find = initFX('Web - Course Data');
    //$find = initFX('WebCourseData');
    $find->AddDBParam('Special Indicator','Yes');   
    $result = $find->FMFind();
    $errorCode = $result['errorCode'];
    $data = $result['data'];
    if ($errorCode == 0) foreach ($data as $key => $val) return $val;
//  else pre($errorCode,'ERROR');
    return false;


This is the dump that is returned:



Share this post

Link to post
Share on other sites

I have found some additional information.  From the dump listed above:  if you paste the URL into a browser it will display the correct result.  We have downgraded our filemaker server back to version 12.  Everything is working fine!!!


I captured the XML generated from from FileMaker 13 and the XML generated from FileMaker 12 and compared the two files.  There was one major difference in the files:


FileMaker 12: ( = ipaddress)




FileMaker 13:




notice how the port # changed between the two versions.  Also the ipaddress was replaced with localhost.

My last post may have stripped the port #s


12 = ipaddress:80


13 =  localhost:16020


Share this post

Link to post
Share on other sites



I also experienced a broken solution when FileMaker Server 13 is installed.


Download the fx.php from the site again and use those files.  Chris Hansen did do some modifications to the code for

Server 13, but there is not documentation that tells you so.  After I installed the new version I was able to get it working



Here is his post:




Upgrade your FX.php install.  There was an odd little glitch introduced in FileMaker 13 (a trailing question mark on a POST URL will break things) and FX needed to be tweaked.  Now if only FMI would fix the XML schema they broke in FMS12... ;-) 


--Chris Hansen 
  Creator of FX.php 
  "The best way from FileMaker to the Web." 



He also mentions the XML schema, which may be related to your issue.


I also had to edit my php.ini file to allow SSL ( I'm also using swift mailer ).






Share this post

Link to post
Share on other sites

As relates to FM Server 13 and FX

Further study of this issue has brought about the following:


Setting your server_data.php file in FX:


For some reason the only way I could get it to work was by entering the data as follows:


$serverIP = localhost ;

$webCompanionPort = 80 ;
$dataSourceType = FMPro7 ;
//$webUN = ‘’;
//$webPW = ‘’;
$scheme = http;
notice the absence of the single apostrophes around the variable values
since I am not a PHP expert, I am going to assume that variables should no longer use quotes of ANY kind????
This has at least gotten me to the point of being able to retrieve the XML needed to continue the process, however
the XML issue is still not solved.
Progress updates to come, as I am now tackling this issue until it is resolved.

Share this post

Link to post
Share on other sites

I fought with this too.   I held off upgrading my solutions' server to Filemaker Server 13 because I was unable to get my web portal, which depends upon FX.php, to work.  


I'd even tried the latest master from the Github repo ( ).   Didn't work.  


I was looking at the repo and noted that Atsushi Matsuo had forked and made some changes in his INTER-Mediator branch at Github ( ). 


This worked!


He had made some changes to the RetrieveFM7VerboseData class which seems to have fixed the problem for me.   I have been testing this on a virtualized Windows 2008 development server running FMS13.   If all of my regression testing works out, I will upgrade my production system tonight.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0