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 script to test connection

Featured Replies

  • Newbies

Can someone give me a basic script to test the FM connection. I've tried an fx script and a filemaker.php script, and can't tell by the errors if it's connecting or not. Here are the two files I've tried:

<?php

error_reporting (E_ALL);

define('DEBUG', true);

require_once('FX.php');

require_once('FMErrors.php');

define('FM_IP', 'xxx.xxx.x.xxx');

define('FM_PORT', '80');

define('FM_VERSION', 'FMPro7');

define('FM_USERNAME', 'xxx');

define('FM_PASSWORD', 'xxx');

$returnCount=200;

$instanceName=new FX(FM_IP, FM_PORT, FM_VERSION);

$instanceName->SetDBData('Web_Forms', 'Orders_ListView', $returnCount);

$instanceName->SetDBUserPass(FM_USERNAME, FM_PASSWORD);

$instanceName->AddDBParam('Order_Number', "TSR179412");

$Result=$instanceName->FMFind();

echo $Result."<br>";

echo "Hello Trish 1";

The page I get has this:

Accessing FileMaker Server 7+ data.

Using FileMaker URL: http://web:[email protected]&-find

Catchable fatal error: Object of class FX_Error could not be converted to string in E:InetpubwwwrootFormsBuildings.php on line 24

Clicking on the link takes me nowhere, so I’m not sure if it’s getting connected or not.

The second script I tried was with filemaker.php:

<?php

require_once ('FileMaker.php');

$fm = new FileMaker();

$fm->setProperty('database', 'WEB_Forms');

$fm->setProperty('hostspec', 'http://xxx.xxx.x.xxx/');

$fm->setProperty('username', 'xxxxxxx');

$fm->setProperty('password', 'xxxxxxx');

$connected = $fm->listLayouts();

If(FileMaker::isError($connected)){

echo "not connected";

} else {

echo 'connected';

}

?>

and get this response:

Warning: require_once(C:Program FilesFileMakerFileMaker ServerWeb Publishingpublishing-enginephpincludesImplementationParser/../../Layout.php) [function.require-once]: failed to open stream: No such file or directory in C:Program FilesFileMakerFileMaker ServerWeb Publishingpublishing-enginephpincludesImplementationParserFMResultSet.php on line 2

Fatal error: require_once() [function.require]: Failed opening required 'C:Program FilesFileMakerFileMaker ServerWeb Publishingpublishing-enginephpincludesImplementationParser/../../Layout.php' (include_path='.;C:Program FilesFileMakerFileMaker ServerWeb Publishingpublishing-enginephpincludes;E:InetpubwwwrootFormsFX;E:InetpubwwwrootFormsFileMaker;E:InetpubwwwrootFormsFileMakerImplementation') in C:Program FilesFileMakerFileMaker ServerWeb Publishingpublishing-enginephpincludesImplementationParserFMResultSet.php on line 2

13 minutes ago · Like

The error occurred before the php script connected to your database. In your Filemaker.php script, it appears that you do not have the correct path to FileMaker,php in your require_once() statement. There should be a FileMaker directory at the same level as FileMaker.php which contains a number of other required files which FileMaker.php is expecting to find. These would both have to be in the same directory as yourscript.php (because of your require_once path). That directory will have to be in the correct directory on the server, most likely E:Inetpubwwwroot.

I am not familiar with FX.php, so I can't help on that side.

  • Author
  • Newbies

Finally fixed! I uninstalled FMS, rebooted and reinstalled FMS back onto the E: drive ... reset my IIS, and voila! All is tested and working as intended!

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.