12 Replies Latest reply on Dec 16, 2015 6:01 AM by james.saldana

    FMS 14 using alternate web port breaks PHP

    james.saldana

      Title

      FMS 14 using alternate web port breaks PHP

      Your post

      Hi,

      I'm using two alternate ports 8591 for HTTP and 4591 for HTTPS. Using any alternate port seems to break any connection with PHP custom web publishing.

      My PHP scripts which access "$fm = new FileMaker (database, server, login, password) no longer work.

      I've tried add the port number e.g. my.domain.com:portnumber

       

        • 1. Re: FMS 14 using alternate web port breaks PHP
          paul_tuckey

          Bump!

          Im running into the same issues here. FMS 14 Single Machine deployment on WindowsServer 2012R2.

          Port 80 and 443 are already being used by another server so I have to use 83 for HTTP and 447 for HTTPS.


          Do I need to edit the php.ini file or other config files?

          I don't need spoon feeding but would be thankful for any enlightenment on this matter.


          Thanks, Paul

          • 2. Re: FMS 14 using alternate web port breaks PHP
            paul_tuckey

            OK if this is driving you nuts heres the fix that worked for me.

             

            $fm->setProperty('hostspec', 'http://localhost:83');

             

            If you installed FMS14 with alternate ports configured. You have to put the alternate port number in your hostspec url. In my case this is port 83.

             

            I created simple database called test.fp12 with PHP enabled account, UserName = web, Password = w3b

            I placed a file called test.php here...

            "C:\Program Files\FileMaker\FileMaker Server\HTTPServer\conf\test.php"

             

            test.php consists of the code in this very useful article from Soliant. Which explains how to check if your file is working with CWP.

            The only thing tI changed in the example code was to add the port number :83 to the hostspec url.


            This begs the question, Can I have both port 83 and port 447 listed in the hostspec file? As I would like to enable http &  https. I tried adding both but no joy.

             

            But for now Im just happy that it works.

            • 3. Re: FMS 14 using alternate web port breaks PHP
              james.saldana

              I think I tried that or maybe of was thinking of trying that.

               

              The only thing unique about my setup is that the PHP calls are being made from a remote Linux web server to our local OS X Server.

               

              Regarding the http and https ports why would you want both? I direct everything to https (ssl).

              • 4. Re: FMS 14 using alternate web port breaks PHP
                paul_tuckey

                I think I tried that or maybe of was thinking of trying that.

                Did it work out? Would be interested to confirm this works with multiserver configurations.

                The only thing unique about my setup is that the PHP calls are being made from a remote Linux web server to our local OS X Server

                So im guessing if your hostspec property look like this...

                $fm->setProperty('hostspec', 'https://Your_IP_Address_Here:4591');

                All should be fine and dandy? So long as port 4591 is open on any firewalls between the servers?

                Regarding the http and https ports why would you want both? I direct everything to https (ssl).

                True. Buoyed by the excitement in getting my setup working I didn't think it through. One is all you need.

                • 5. Re: FMS 14 using alternate web port breaks PHP
                  james.saldana

                  Hi Paul, I haven't had a chance to implement this solution but when I do I'll you know how it works out. Thanks!

                  • 6. Re: FMS 14 using alternate web port breaks PHP
                    james.saldana

                    FileMaker Server and a Linux Webserver | Goya Pty Ltd

                     

                    The instructions in the link resemble my situation.

                     

                    The key is that in addition to changing the 'host spec' in the website PHP file the $__FM_CONFIG['host spec'] in the FileMaker.php folder also needs to be configured to connect to the remote server.

                     

                    FileMaker/conf/filemaker-api.php

                     

                    $__FM_CONFIG['hostspec'] = 'http://158.181.132.144:8591';

                    • 7. Re: FMS 14 using alternate web port breaks PHP
                      beverly

                      james, this seems reasonable (to make the changes you listed)

                       

                      to all: did anyone try port forwarding? or is that not possible in your situations?

                      beverly

                      • 8. Re: FMS 14 using alternate web port breaks PHP
                        james.saldana

                        Hi Beverly,

                         

                        The instructions in the link work.

                         

                        FileMaker Server and a Linux Webserver | Goya Pty Ltd

                         

                        These instructions are for people using a Linux server as your web server and OS X or Windows as your FM Server.

                         

                        You just need to make sure BOTH host specs are updated; one in the FM PHP API config (remote Linux web server) and the one in your web page's PHP file (remote Linux web server).

                         

                        I settled on 8591 (http) and 4591 (https) since they don't seem to be used as standard ports for any common applications or processes on an OS X Server. I don't know if any Windows processes use those ports.

                         

                        You'll need to forward the ports if your server is behind a firewall and/or NAT.

                         

                        I'm still running tests using OS X El Capitan. I will provide detailed instructions once everything has been vetted.

                        • 9. Re: FMS 14 using alternate web port breaks PHP
                          beverly

                          Thanks, James! that's valuable information. I still wonder if port forwarding is being used for these kinds of 'gotchas'.

                          • 10. Re: FMS 14 using alternate web port breaks PHP
                            james.saldana

                            I've finally been able to run a full test using the following configuration. It worked for a day and then at some point after 24 hours FMS would no longer accept connections; I believe its related to OS X Server although NO services were running. I've since reverted back to the standard FMS ports.

                             

                            It's worth noting that I was unable to apply the FMS 14.0.4.413 update to FMS 14.0.4.412 until I disabled the OS X Server app by removing it from the Applications folder. After the update I was able to re-enable the OS X Server app. FileMaker failed to mention this installation requirement.

                             

                            --- OS X Server (FMS Host) & Linux (Remote Web Server [WAN]) ---

                             

                            OS X Server 10.11.2 - El Capitan

                            FMS 14.0.4.413

                             

                            - Configured FMS Web Server during installation to 8591 (http) and 4591 (https)

                            - Configured OS X firewall to open ports 8591 (http) and 4591 (https)

                            * Made no other changes on the this server

                             

                            On my remote Linux Server I installed FMS PHP API

                             

                            - Configured filemaker-api.php

                             

                            /**

                            * The default hostspec (http://127.0.0.1:80, for example). Avoid using http://localhost:80/

                            * as it can cause peformance loss. DO NOT include /fmi/xml in this string.

                            */

                            $__FM_CONFIG['host spec'] = 'https://my.domain.com:4591';

                             

                            - Configured the PHP file on the Web Server which is displaying data on the web

                             

                                    // Include the FileMaker API

                                    require_once 'FileMaker.php';

                             

                                    // Make a connection with the FileMaker server

                                    $fm = new FileMaker('database','https://my.domain.com:4591','login','password');

                            • 11. Re: FMS 14 using alternate web port breaks PHP
                              Mike Duncan

                              I think it is really best practice now to dedicate a machine (or two) to FM Server. That includes not changing the ports on server.

                               

                              If you are on a shared IP with other servers, you can add some port mapping at the router, but I wouldn't change the ports at the server.

                               

                              And using the FM PHP API on a linux server can also work if you just put the files somewhere to and reference them directly. You don't always have access to the ini file, so this works as well.

                               

                              Mike

                              • 12. Re: FMS 14 using alternate web port breaks PHP
                                james.saldana

                                1. I didn't change the ports on FMS. I installed it using the alternate ports which are now an advertised feature of FMS.

                                 

                                2. I'm not on a shared IP. I have a static (dedicated) IP address on a MacPro with a 1Gbps uplink.

                                 

                                3. There is no firewall of any kind on the router. I have a direct link to the internet.

                                 

                                4. The PHP API is on the Linux sever and is being referenced directly. I know from testing the ini file on the remote Linux server must be configured.

                                 

                                5. It works.

                                 

                                What I know now from another thread with TSGal is that some people are having an issue with the FMS daemon crashing. This causes the services to stop after a few days. Appears to be a bug on OS X FMS because the same setup on a Windows FMS server works; regardless of wether the standard or alternate ports are used.