Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FX.php generating a rouge error 502?

Featured Replies

When trying to convert my php which previously worked with FM6 (and an older copy of FX.php), I have been having real difficulties finding the source of a problem:

When I attempt a simple query using FX, I get an error 502 back. When I try the query myself, directly requesting it from FMSA7, the 'errorcode' element is 0.

This is the dump from the FX query response:


Array

(

    [data] => Array

        (

        )



    [linkNext] => 

    [linkPrevious] => 

    [foundCount] => -1

    [fields] => Array

        (

        )



    [url] => http://server/fmi/xml/FMPXMLRESULT.xml?-db=Flat+Codes&-lay=Web&-max=15&Property+Code.op=eq&Property+Code=572&-find

    [query] => 

    [errorCode] => 502

    [valueLists] => Array

        (

        )



)



When I try the URL myself, there is no error. How/why could FX generate this error itself? Does anyone have any ideas?

Cheers.

  • Author

I've fixed it - the problem was in the FX.php file.

Basically, I sourced the problem when I looked at the local web server logs. I saw a whole load of POST requests coming from my ISP web server (where the PHP is running from) and a load of GET requests coming from me directly. I noticed that the POST requests were only returning around 400 bytes, whereas the GET requests were returning over 4000 bytes. This lead me to believe that the FileMaker server doesn't like POST requests.

Having looked through the FX.php file, I saw there was a variable called $isPostQuery. Initially (on line 103) the variable is set to false, however on line 187, in the 'ClearAllParams()' function the value was being set to true:

$this->isPostQuery = true;

I changed this to false, to ensure that FX was performing GET requests and now it seems to work fine.

I don't know why the FM Server didn't accept the POST request - whatever it is, it's a problem within FX.php. I'll email the author to let him know of the bug.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.