13 Replies Latest reply on Aug 25, 2016 8:28 AM by kamal1234

    communication error : Change in Server

    kamal1234

      Dear community members,

       

      My website is using php and filemaker as database. It is running successfully on server1.

       

      I migrated the code and database on server 2. Code and every thing else remains the same.

       

      I have also tried to open the  few ports like 2399,5003 and also disabled the firewall on the server but still result is the same.

       

      Please anybody can guide me about it.

       

       

      Error Message: Communication Error: (22) The requested URL returned error: 401 Unauthorized - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user.

       

      Kamal.

       

       

       

       

        • 1. Re: communication error : Change in Server
          Johan Hedman

          What do you mean by migrating to Server2? Did you update your software to a newer version? When installing FileMaker Server you can always choose to install on one or two computers. When working with the Webpublising Engine (WPE) it´s best practise to use two computer installation to benefit the security purpose and a lot more.

          • 2. Re: communication error : Change in Server
            kamal1234

            Hello Johan

             

            I did not touch the filemaker part. Just moved my php files from one hosting to another hosting server.

             

            Kamal.

            • 3. Re: communication error : Change in Server
              Johan Hedman

              In your FileMaker Server settings you need to use the guide for setting up your Web Publishing Engine. It is in the FileMaker Admin Console at the top right corner.

              • 4. Re: communication error : Change in Server
                kamal1234

                Hello Johan,

                 

                I have redeployed the server but it  is the same. Is it possible that windows 2012 server might be blocking the connection?

                 

                Kamal.

                • 5. Re: communication error : Change in Server
                  wimdecorte

                  It still not clear how you have things deployed.  You mention that you migrated not just the PHP files but also the databases to server 2?

                   

                  So on what server are the FM files?

                  On what server is the FM web publishing Engine?

                  • 6. Re: communication error : Change in Server
                    kamal1234

                    Hello Wimdecorte,

                     

                    Thank you for looking into my problem.

                     

                    I have filemaker server running on windows 2012 server. I am using File Maker 2014 Adv with 2014 FM server.

                     

                    Application was running successfully till I moved my php files. PHP files includes FMPHP library.

                     

                    I have migrated my php part from one server to another. I don't see any thing on windows 2012 blocking the incoming request neither filemaker.

                     

                    Do I need to open any particular port to make php communication.

                     

                    Thank you

                    Kamal.

                    • 7. Re: communication error : Change in Server
                      Johan Hedman

                      Did you install FMS having the local administration privilege set in your OS?

                      • 8. Re: communication error : Change in Server
                        kamal1234

                        Hello,

                         

                        I have try to dump the error. I am getting following.

                         

                        - I have PEAR install

                        - FMPHP privilege is set as it was working code

                         

                        Can my windows 2012 server prevent communication?

                        I tried to create inbound and outbound rules but did not help......

                         

                        [error_message_prefix] =>

                        [mode] => 1

                        [level] => 1024

                        [code] => 22

                        [message] => Communication Error: (22) The requested URL returned error: 401 Unauthorized - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user.

                        [userinfo] =>

                        [backtrace] => Array

                        (

                        [0] => Array

                        (

                        [file] => /home/wrdss/public_html/libraries/FileMaker/Error.php

                        [line] => 50

                        [function] => PEAR_Error

                        [class] => PEAR_Error

                        [type] => ->

                        [args] => Array

                        (

                        [0] => Communication Error: (22) The requested URL returned error: 401 Unauthorized - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user.

                        [1] => 22

                         

                        Thank you

                        Kamal.

                        • 9. Re: communication error : Change in Server
                          Johan Hedman

                          Error Message says that you dont have correct username and password in your PHP-file

                          • 10. Re: communication error : Change in Server
                            kamal1234

                            Hello,

                            This is my curl error dump from FMPHP library.

                            I have user with credentials and FMPHP and other privileges.

                            I have also monitored the curl curl_getinfo it gives 401 error.

                             

                             

                            string(50) "The requested URL returned error: 401 Unauthorized"

                             

                            It has any thing to do with my settings on Windows server where filemaker is hosted.

                             

                            Kamal

                            • 11. Re: communication error : Change in Server
                              Johan Hedman

                              Error code 401 is No records found from what I remember

                              • 12. Re: communication error : Change in Server
                                wimdecorte

                                kamal1234 wrote:

                                 

                                 

                                It has any thing to do with my settings on Windows server where filemaker is hosted.

                                 

                                Kamal

                                 

                                There's a simple way to find out: provided that you also have the XML API turned on in FMS: use the XML api from a browser to hit your webserver and ask for some FM XML through URLs, targeting the same file and layout as your PHP code does, using the same account

                                 

                                If you are not familiar with the XML API, check the FM web publishing guide, it has a bunch of examples.  Really the only thing you need to do is ask for a random record will look something like this (but check the guide for the correct syntax)

                                 

                                http://<your web server>/fmi.xmlfmresultset.xml?db=<your file>&-lay=<your layout>&-findany

                                 

                                This test will tell you whether you can connect to your FMS at all and may give you a bit more info.

                                • 13. Re: communication error : Change in Server
                                  kamal1234

                                  Hello Johan,

                                   

                                   

                                    $FM1 = new FM();

                                    $r = $FM1->listDatabases();

                                    print_r($r); exit;

                                   

                                  I am running simple list database call.

                                   

                                  Dump from curl is

                                   

                                  array(27) {
                                    ["url"]=>
                                    string(45) "http://74.116.120.142/fmi/xml/fmresultset.xml"
                                    ["content_type"]=>
                                    NULL
                                    ["http_code"]=>
                                    int(401)
                                    ["header_size"]=>
                                    int(0)
                                    ["request_size"]=>
                                    int(247)
                                    ["filetime"]=>
                                    int(-1)
                                    ["ssl_verify_result"]=>
                                    int(0)
                                    ["redirect_count"]=>
                                    int(0)
                                    ["total_time"]=>
                                    float(1.137806)
                                    ["namelookup_time"]=>
                                    float(7.6E-5)
                                    ["connect_time"]=>
                                    float(0.054099)
                                    ["pretransfer_time"]=>
                                    float(0.054198)
                                    ["size_upload"]=>
                                    float(8)
                                    ["size_download"]=>
                                    float(0)
                                    ["speed_download"]=>
                                    float(0)
                                    ["speed_upload"]=>
                                    float(7)
                                    ["download_content_length"]=>
                                    float(-1)
                                    ["upload_content_length"]=>
                                    float(8)
                                    ["starttransfer_time"]=>
                                    float(1.137784)
                                    ["redirect_time"]=>
                                    float(0)
                                    ["certinfo"]=>
                                    array(0) {
                                    }
                                    ["primary_ip"]=>
                                    string(14) "74.116.120.142"
                                    ["primary_port"]=>
                                    int(80)
                                    ["local_ip"]=>
                                    string(12) "69.27.112.30"
                                    ["local_port"]=>
                                    int(55466)
                                    ["redirect_url"]=>
                                    string(0) ""
                                    ["request_header"]=>
                                    string(239) "POST /fmi/xml/fmresultset.xml HTTP/1.1
                                  Host: 74.116.120.142
                                  Accept: */*
                                  X-FMI-PE-ExtendedPrivilege: tU+xR2RSsdk=
                                  X-FMI-PE-Authorization: Basic d2ViX3VzcjoyNjUxa0pK
                                  Content-Length: 8
                                  Content-Type: application/x-www-form-urlencoded
                                  "
                                  }
                                  string(50) "The requested URL returned error: 401 Unauthorized"

                                  Thanks

                                  Kamal.