2 Replies Latest reply on Nov 7, 2013 3:46 PM by StefanWeaver

    PHP API Not Well-Form (Invalid Token)



      PHP API Not Well-Form (Invalid Token)

      Your post

           I've tried every test script and example to connect to my databases.  I even have tried the listdatabases.php test that is bundled with FileMaker and I still get the "XML is not well-formed (invalid token)" error.  Any help?  Is something not set up correctly?  I went through the process of making sure the databases are ready for custom web publishing.

           ~ Stef

        • 1. Re: PHP API Not Well-Form (Invalid Token)

               Stefan Weaver:

               Thank you for your post.

               Please post some of your PHP code, as this might help determine the cause.

               Try creating a layout with one field and try referencing that layout/field.  Does this work?  If so, then we can focus on the specific layout.

               Try creating a new database file with one layout, one text field, and one record.  Are you then able to access the file via PHP?

               Any other information you can provide may be helpful.

               FileMaker, Inc.

          • 2. Re: PHP API Not Well-Form (Invalid Token)

                 Here is the code.  Its the example code with the FileMaker Server.  I didn't do anything to it.   I still get the error.   I didn't try the database stuff yet as I am doing this for a client and don't want to change or add anything without permission.

                 // Include FileMaker API
                 require_once ('FileMaker.php');

                 // Create a new connection to server without specifying database or hostspec.
                 $fm = new FileMaker();

                 // Set 'hostspec' property using setProperty()
                 $fm->setProperty('hostspec', 'http://localhost');

                 $databases = $fm->listDatabases();

                 // If an error is found, return a message and exit.
                 if (FileMaker::isError($databases)) {  
                     printf("Error %s: %s\n", $databases->getCode());

                 Thanks for the help!