1 2 Previous Next 25 Replies Latest reply on Aug 10, 2017 5:59 AM by beverly

    PHP Server on Newly Deployed FMS 16 not working

    AlanBrooks

      I have deployed a two-machine Filemaker server (FMS 16.0.2.212 on both machines).  Both machines are virgin macOS 10.12.6 on freshly formatted hard disks and, as such, the Filemaker installations are new installs rather than upgrades from previous versions. 

       

      Deployment was all successful on first attempt and database hosting to Filemaker clients is working properly.

       

      Deployment of the web worker machine seemed to be completely successful as well but after copying my php files to the web server, it responds with following error when they are accessed:

      "The requested URL was not found on this server. The link on the ">referring page seems to be wrong or outdated. Please inform the author of ">that page about the error. If you entered the URL manually please check your spelling and try again."

       

      Even a simple php file that does not rely on connectivity to the FM database server is not rendered. (  for example - <?php

      echo phpinfo(); ?>  )

       

      When, however, I access an html file placed on the worker machine, it serves it properly as well as images that reside on the server.  It appears as though .php has been added to the server's accepted file extensions in /Library/FileMaker\ Server/Web\ Publishing/publishing-engine/php/sierra/httpd.fmi.conf.php as well as /Library/FileMaker\ Server/Web\ Publishing/publishing-engine/php/sierra/httpd.conf.php

       

      PHP is enabled in the Admin Console on the Master and I've attempted access via http"// and https:// with the setting Admin Console setting "Use HSTS for web client" turned on or off respectively. 

       

      I have also read of others having this issue although not with exactly the same circumstances as mine and have re-deployed the Master server once without any change.

       

      Can someone point me to anything else I could check?

        • 1. Re: PHP Server on Newly Deployed FMS 16 not working
          mikebeargie

          I believe you are using the wrong folder, which is why you are getting an error. The correct location to store .php code in order to host it inside of your filemaker install is here:

           

          /Macintosh HDD/Library/FileMaker Server/HTTPServer/htdocs/

           

          Please confirm that you are placing the sample phpinfo(); file in that location, and try loading it on the server browser using something like http://localhost/test.php

          • 2. Re: PHP Server on Newly Deployed FMS 16 not working
            AlanBrooks

            Thanks Mike.

             

            But that's where the files have been placed:

            /Macintosh HDD/Library/FileMaker Server/HTTPServer/htdocs/   when using http://

            /Macintosh HDD/Library/FileMaker Server/HTTPServer/htdocs/httpsRoot  when using https://

             

            As I said, images and html files ARE rendering properly with the same path, just not php so location can't the culprit.

            • 3. Re: PHP Server on Newly Deployed FMS 16 not working
              mikebeargie

              Did you check the box during installation for filemaker to install its own version of PHP? Or have you done this separately?

              • 4. Re: PHP Server on Newly Deployed FMS 16 not working
                AlanBrooks

                Yes.  I am running Filemaker installed PHP.

                • 5. Re: PHP Server on Newly Deployed FMS 16 not working
                  AlanBrooks

                  Update on this thread:

                   

                  I am attempting to use the worker as the PHP server as I have in the past.  I do see on deployment of the worker that it's stipulated as a WebDirect worker and I have been successful in placing the PHP files on the master and making that work.

                   

                  But the whole reason I have ever run a worker machine (since version 10  at least if not earlier) was to give me an opportunity to restart the web publishing engine without restarting the database server.  Our company is in Filemaker constantly and I cannot be restarting the DB server during business hours.

                   

                  Is there no way to change the PHP server to the worker machine?  If not, I really have no use for a two-machine deployment any longer.

                  • 6. Re: PHP Server on Newly Deployed FMS 16 not working
                    databuzz

                    Hi Alan,

                     

                    There's been in change with 2 machine deployments and Custom Web Publishing with FileMaker Server v16. On page 19 of the FileMaker® Server16 Installation and Configuration Guide is states:

                     

                    "The Web Publishing Engine on a worker machine does not include Custom Web Publishing services or the PHP engine; these components are on the master machine. However, a worker machine can handle these requests from users because it provides routing services."

                     

                    I'm not 100% clear about the last sentence and would like some clarification here myself, but if you look at the image on page 21 showing the 2 machine deployment you'll see the PHP Engine is on the master machine, but not sure how the "routing services" works here when you want to use a worker machine to handle the requests for the PHP pages. I haven't had a chance yet either to setup a 2 machine deployment with v16 - I have many of these currently with v15 so am holding off upgrading until I understand how the 2 machine deployment works for CWP.

                    2 of 2 people found this helpful
                    • 7. Re: PHP Server on Newly Deployed FMS 16 not working
                      beverly

                      LisaRose ?

                      Any clarification on what @databuzz & AlanBrooks asked? (two machine deployment/CWP)

                       

                      Beverly

                      • 8. Re: PHP Server on Newly Deployed FMS 16 not working
                        tcfitzgerald

                        I removed my original post because I thought maybe I misunderstood the question (turns out I didn't).  Should have just left it up but edited it instead....

                         

                        Anyway, what the last sentence means is that the Worker machines proxy the requests to the Master for CWP and PHP, so that any CWP and PHP requests that come to the Worker are forwarded to the Master to be handled.

                         

                        No CWP or PHP work is actually done on the Worker because the CWP and PHP engines are not installed.

                         

                        If you are using Windows, you can look at the IIS URL Rewrite rules on the Worker to see what is happening (I don't have a FMS 16 two-machine config at the moment, otherwise I'd provide a screenshot).

                        2 of 2 people found this helpful
                        • 9. Re: PHP Server on Newly Deployed FMS 16 not working
                          CarlSchwarz

                          AlanBrooks wrote:

                           

                          But the whole reason I have ever run a worker machine (since version 10 at least if not earlier) was to give me an opportunity to restart the web publishing engine without restarting the database server. Our company is in Filemaker constantly and I cannot be restarting the DB server during business hours.

                           

                           

                          I guess you already know this, but pointing out that you can use the fmsadmin console command to restart WPE without restarting the whole FM Server.

                          1 of 1 people found this helpful
                          • 10. Re: PHP Server on Newly Deployed FMS 16 not working
                            AlanBrooks

                            Thanks for all the response on this topic.

                             

                            I'd read that sentence in the FileMaker® Server16 Installation and Configuration Guide and I remain a bit confused by the wording databuzz referenced.  I take this to mean that, while CWP and the PHP engine have been moved to the master, that requests like:

                             

                            https://filemaker_worker_machine/custom_web_publishing_file_on_master_machine.php

                             

                            would work.  In my experience so far, this is not the case.  Am I construing the statement incorrectly or is this how other are reading it?

                            • 11. Re: PHP Server on Newly Deployed FMS 16 not working
                              AlanBrooks

                              Yes CarlSchwarz, I am aware of the command line to restart the WPE but, in my experience with earlier versions (probably 10 through at least 14), a complete restart was the only way to get the publishing engine running properly again.

                              • 12. Re: PHP Server on Newly Deployed FMS 16 not working
                                databuzz

                                I'm reading this the same way, but we need someone who has successfully deployed a 2 machine deployment with CWP with the PHP files located on the web server/worker machine to chime in here.

                                1 of 1 people found this helpful
                                • 13. Re: PHP Server on Newly Deployed FMS 16 not working
                                  LisaRose

                                  Hi AlanBrooks, databuzz, & beverly: My team didn't test this directly in FMS 16 (we were focused on WebDirect instead). But we just did some experimenting with it (because we've tested PHP in previous releases, and were curious).

                                   

                                  It is definitely true that in FMS 16, PHP is only meant to be served from the Master machine (that was intended behavior from the start). Multiple machine deployments (and the new load balancer) are now just to improve WebDirect performance. So yes, Alan, if you only do CWP, there is probably no point in doing a two-machine configuration anymore. Don't think it will even work for the old purpose of having the web server outside the firewall, but the DBS machine inside it.

                                   

                                  The part we're currently not certain about is the re-routing or proxy behavior. The FileMaker Server 16 Release Notes | FileMaker currently say "In a multiple-machine deployment, Custom Web Publishing solutions must be hosted on the master machine. Custom Web Publishing requests are proxied through the worker machine to the master machine."

                                   

                                  The underlined portion above suggests that you can place a PHP file in the htdocs folder (on macOS) of the Master machine, and then point to the Worker machine address to access it (http://workeraddr/file_in_master_htdocs.php), and it will then serve that PHP file (while retaining worker's address in URL, unlike visible URL address change that occurs via load balancer in WebD). And that probably does work in a pure http environment. However, it doesn't seem to work in an https environment (as we were testing with), if you place PHP file in httpsRoot subfolder under htdocs  (https://workeraddr/file_in_master_httpsroot.php). However again, if you move that file back up to htdocs parent, then it does seem to work with https request (https://workeraddr/file_in_master_htdocs.php).

                                   

                                  Last result above may be explained by RewriteRule in httpd-proxy-ssl.conf (which seems to redirect https worker request behind the scenes to http request against master). But we're not certain why it's doing that (and haven't been able to make it work so far with httpsRoot by editing that file). And it doesn't seem quite right to make an insecure request between the two machines in an otherwise secure chain. But we will explore this some more and potentially write a bug about it.  Thanks for raising the issue.

                                  2 of 2 people found this helpful
                                  • 14. Re: PHP Server on Newly Deployed FMS 16 not working
                                    beverly

                                    Lisa, thank you for taking the time to explain more about CWP in the mix even though your focus is Web Direct. Many of us web devs work with both, so it is important to try to get this detail of information in the documentation ASAP. The installation guide, for example should advise the proper location for each in the various machine configurations.

                                     

                                    We know that CWP can be done from another web server with the "FM_API_for_PHP_Standalone" and pointing to where the data is hosted by FileMaker Server. As my philosophy is "single point of failure", my typical advice is separate as much as possible:

                                    • FMServer Master (data hosting)

                                    • Worker (Web Direct only)

                                    • Web Server with PHP (use the standalone to communicate with the data)

                                    • ... any other server as required in a hosted solution

                                    But that's me.

                                     

                                    Beverly

                                    1 of 1 people found this helpful
                                    1 2 Previous Next