7 Replies Latest reply on Dec 3, 2012 9:53 PM by mdenyse

    Communication Error (6):

    artdezign

      Hi,

       

      Does anyone know about Communication Error (6)? This is the exact error message I get:

       

      Database Error: Communication Error: (6) Could not resolve host: $DB_HOST; nodename nor servname provided, or not known

       

      I have a book that says that Filemaker Error Code 6: File is read only.

      But this looks like a connection issue considering that it is happening during the access portion of the script.

      I have also verified that the credentials I am using have full access privledges, and that the php script is sound (it has worked with another file).

       

      Any ideas? Help would be greatly appreciated.

        • 1. Re: Communication Error (6):
          LyndsayHowarth

          Perhaps the file is read-only.

          How did you add it to the server?

           

          If you didn't add it using the Admin Console upload command, then it wouln't have been given the right permissions.

           

          - Lyndsay

          • 2. Re: Communication Error (6):
            LyndsayHowarth

            Also, you haven't told us which platform you are using or any of the other details about the server or a sample of your code. The only info we have is the error message... which in my experience would be an accurate description of the problem.

             

            - Lyndsay

            • 3. Re: Communication Error (6):
              artdezign

              What kind of server specs do you need?

               

              I'm using Filemaker Server Pro 12

               

              Here is my code:

               

              <?php

              $postsFind = $fmBlog->newFindAllCommand('BlogPosts'); // initialize layout parameter

              $posts = $postsFind->execute(); // execute return as results

               

               

              if(FileMaker::isError($posts)) { // check for errors

                        die('Database Error: '.$posts->getMessage());

              }

              ?>

               

              I can get the results I'm looking for if I comment out the error section of the code, which tells me it's not really a permissions problem because I can access the data, and echo it out. I'm also able to CRUD the information using the same login information via Filemaker Pro. 

              • 4. Re: Communication Error (6):
                mdenyse

                You stated the error is:

                 

                Database Error: Communication Error: (6) Could not resolve host: $DB_HOST; nodename nor servname provided, or not known

                 

                PHP is telling you the character string '$DB_HOST' is not a valid hostname/IP address.

                 

                To me, that suggests the variable $DB_HOST (which I assume has the host name/IP Address of your server) is being quoted - PHP is evaluating your hostname as the value $DB_HOST, not the value stored in $DB_HOST. Could you be putting quotes around $DB_HOST in your call to new FileMaker() or setProperty()?

                 

                Mark

                1 of 1 people found this helpful
                • 5. Re: Communication Error (6):
                  artdezign

                  Not double quotes, but single quotes.  Looks like this: (with edited info obviously)

                   

                  <?php

                      require_once('FileMaker.php');

                  ?>

                   

                   

                  <?php

                  $DB_HOST = 'FM-12.server.space.com';

                  $DB_NAME = 'DATABASE_NAME';

                  $DB_USER = 'Jerry';

                  $DB_PASS = '198765jhyy';

                  ?>

                   

                   

                  <?php $fmBlog = new FileMaker('$DB_NAME', '$DB_HOST', '$DB_USER', '$DB_PASS');?>

                  1 of 1 people found this helpful
                  • 6. Re: Communication Error (6):
                    databuzz

                    Looks like the issue is in the last line.

                     

                    It normally would look something like this:

                     

                    $fm = new FileMaker($database, $hostname, $username, $password);

                     

                    Try changing it to:

                     

                    <?php $fmBlog = new FileMaker($DB_NAME, $DB_HOST, $DB_USER, $DB_PASS);?>

                     

                    and see if that makes a difference. You are defining your connection variables correctly but you are then quoting them when you instantiate the connection object so it's looking for a server with an IP address/host name of "'$DB_HOST'" rather than the variable $DB_HOST.

                     

                    hth,

                    Andrew

                     

                    FileMaker 12/11/10/9/8 Certified Developer

                    Databuzz

                    - - - - - - - - - - - - - - - - -

                    Phone: +61 2 9484 6565

                    Mobile: +61 418 468 103

                    Email: andrew@databuzz.com.au

                    http://www.databuzz.com.au

                    • 7. Re: Communication Error (6):
                      mdenyse

                      Remove the quotes around the variables in your call to new FileMaker() and it's going to work a lot better.

                       

                      From:

                       

                      <?php $fmBlog = new FileMaker('$DB_NAME', '$DB_HOST', '$DB_USER', '$DB_PASS');?>

                       

                      To:

                       

                      <?php $fmBlog = new FileMaker($DB_NAME, $DB_HOST, $DB_USER, $DB_PASS);?>

                       

                      Mark