Jump to content
Server Maintenance This Week. ×

PHP getting blank page


This topic is 2297 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Running FMS 13 and trying to run a simple PHP page from my website to access a database, but I'm only getting a blank page.  Not sure if it's a port forwarding issue or a PHP issue, or something else.  If I put my .php file and the includes ("FileMaker.php" file and "FileMaker" folder from the FMS PHP .zip file) in the fmi-test folder on my FM server and access it locally (http://localhost/fmi-test/myphpfile.php), the PHP file works fine and returns data, so I don't think it has any inherent issues, and presumably my FMS is set up correctly.  Putting the same .php file and includes on my web server, though, results in a blank page only.  The includes are in the same directory as the php file itself.  Here's the php file (I've changed the IP address and database names to protect the innocent but they're correct):

 

<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);
include_once('FileMaker.php');  /* have also used require, include, and require_once with no change */


$fm = new FileMaker("MyDatabase", "http://myfilemakerserver:8888", "Admin", "");   /*no password*/

$findCommand = $fm->newFindCommand("MyDatabase");
$findCommand->addFindCriterion("Phone", "303-555-1234");
$findCommand->setRange(0, 1);

$result = $findCommand->execute();

if (FileMaker::isError($result)) {
    echo($result->getMessage());
    return;
}

$record = $result->getFirstRecord();

$name = $record->getField("Customer Name");
$status = $record->getField("Status");

echo("$name - $status");

?>

Infuriatingly I get no errors or feedback, just a blank page when I run this file from my website (but again it works fine locally on the FM server machine). I've confirmed PHP is working on my website as I can do a simple phpinfo() file in the same directory and it runs fine and displays the PHP info.  If I direct a web browser to the same "http://myfilemakerserver:8888" (not the real address obviously, but it is port 8888) I get the "Filemaker Database Server Website" page, so the port forwarding seems to be correct.  I have port 8888 forwarding to port 80 of my FM Server.  I don't have port 443 forwarded to that machine as that's being used for another device on our network, but I assume if I'm not making "https" requests that it should work fine (but maybe that's my problem?).  

I assume it's just something simple but I've been beating my head against a wall for the better part of the day on this.  Any help would be greatly appreciated.

Link to comment
Share on other sites

This topic is 2297 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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