4 Replies Latest reply on Sep 20, 2014 3:00 AM by pewi

    Custom Web Publishing with PHP

    pewi

      Hi,

      I am new to this business. I am trying to set up a FileMaker Server deployment and publish data from my database to the web with PHP. I have read "FileMaker® Server 13 Custom Web Publishing with PHP" but I can not quite figure out how to make the configuration. My question is: need the web server and the FileMaker server run on the same host or can I host my web pages with a web hosting provider and put my FileMaker Server with my database on my own Server?

      Kind regards

      Peter

        • 1. Re: Custom Web Publishing with PHP
          robertwoods

          Hi Peter. You can use any web server, so long as you install the Filemaker.php and associated files in the correct place on your web server.

           

          Whatever that web server is, it will makes calls to your Filemaker Server running FMS13 which will return the data from your database. Your web server (whatever that is) will then insert that data into the dynamically generated web page, that will be seen in your browser.

           

          We actually do run FMS13 on a OS X 10.9 server machine. When FMS13 is installed it installs it's own copy of Apache, and grabs the ports and disables Apache that OS X Server had installed. We ran into issues where this did not work, but it turned out to be that the OS X Server (whenever it was restarted) was grabbing back the SSL and non-SSL ports (port 80 and 443) for use with NetBoot. Once we changed the NetBoot volumes to not use those ports, FMS13 works perfectly on OS X 10.9 server.

           

          We run one server configured in this way, and seven other servers running FMS13, and we are able to display stock data from all eight systems on a single web page, using PHP with FMS13. Magic!

          • 2. Re: Custom Web Publishing with PHP
            pewi

            Thanks, Robert, for your quick replay.

            Installing FileMaker PHP on the web server, what does that mean? Do I just upload the files in a folder on my sites with ftp or does it take some more. I mean, my web host (one.com) has a PHP installation of its own. I'm not sure they will allow me to install FM PHP on their server.

            • 3. Re: Custom Web Publishing with PHP
              steve.winter

              As Robert has mentioned when installing FMS 13, it will 'take over' ports 80 and 443 on the machine which it is installed upoon, even if you only do a 'single machine' deployment. According to the documentation it's best to let this happen, and to leave it that way - using that server only for FMS. [practically this isn't strictly speaking necesary, but it is 'best practice' so let's assume that's the plan]

               

              You can install FMS (itself) in two ways, a 'single machine' install, or a 'two machine' install. This refers to the way components of FMS are deployed. In a one machine install both the database engine itself, and the web publising engine are deployed onto the same machine. In this setup your FM Pro clients would open their databases from this machine, and you could (if you wished to) deploy your CWP solution onto that machine. This is also where WebDirect users would connect.

               

              In a two machine config, the database engine is installed on one machine, and the web publishing engine on a second machine. FM Pro clients connect to server one, a CWP solution and WebDirect would use server two. Note that the FMS installer will 'take over' ports 80/443 on both of these machines.

               

              These are the two 'official' ways of dealing with things. There is (amongst a myriad others) another very common deployment for CWP, which is to use an FMS (deployed using either of the above two solutions) and then to place the actual PHP of the solution onto a separate (often Liinux) web server. That machine will communicate over http(s) to the FMS server which has the web publishing engine on it. It will do so using the FileMaker PHP API and it's that which Robert is saying you need to install onto your web server.

               

              Somewhere in you PHP code I'm sure you've got (something like):

                   require_once(FileMaker.php);

               

              On an FMS machine, the FileMaker.php API is added to the PHP include path, so that will 'just work' from any PHP script, however you need to install that to your CWP web server. If you look in your installation on the FMS machien whicvh has the web publishing engine in the folder

                   FileMaker Server/Web Publishing

              you'll find a zip fiel called

                   FM_API_for_PHP_Standalone.zip

               

              This is what you need. You can either unzip that and deploy it with your other CWP code (which is what I do - it makes your code much more portable if it 'ships' with everything it needs) or unzip this onto your web server either in its default 'includes' path, or into another folder, then add that folder as an include path in php.ini.

               

              Your communication will then go

                   Broswer <-> Web server <-> FMS web publishing engine <-> FMS database engine

               

              You will of course need to consider security of your data both between the broswer and the web server, and also between the web server and the FMS web publishing engine [that communication is done using PHP cURL, and results in data being sent back as XML from FMS]. Both of these should ideally be over https.

               

              Hope this helps.

              1 of 1 people found this helpful
              • 4. Re: Custom Web Publishing with PHP
                pewi

                Thanks, Steve

                 

                You have both been very helpfull. I'll try my luck with your advice.

                 

                Thanks, again.