Setting Up FMStudio with FMGateway
From FMWebschool Reference
Setting up FMStudio with the FMGateway server involves mainly setting up the Dreamweaver site with the correct FTP and Testing Server URL prefix settings. The instructions on this page assume you are creating a new site and take you step by step through the process.
Preparing your FMGateway Site
This example will be using a subfolder to store the FMStudio site, which once complete can be moved into the root of your FMGateway account to act as the main site. The subfolder method is often used to separate multiple client projects on a single hosting account.
- Open up your FTP client and connect to FMGateway
- Once connected you should see a number of folders including "httpdocs"
- Enter the directory, this is the root of your web site that is served to the user
- In this directory create a sub folder for this project, name it "HelloWorld"
Creating a New Site
- Select Site -> New Site...
- Select a site name, we will use "Hello World" as the name
- Select a local folder for the files, this can be anywhere on your hard drive, in this example I use "J:\FM\HelloWorld"
- Default images folder can be left blank
- Important Step: Set the "HTTP address" to your subdomain at FMGateway and the subfolder that the files will go into, I use "http://mpetrov.fmgateway.com/HelloWorld/"
- Select "FTP" as the Access
- Set the FTP host to your subdomain at FMGateway without the "http://", I used "mpetrov.fmgateway.com"
- Important Step: For the host directory enter the path relative to where FTP logs in that gets you to the project directory. Since I created the HelloWorld directory inside of the httpdocs folder I entered "/httpdocs/HelloWorld/". If you just use the root of your site then you would need to enter just "/httpdocs/".
- Click Test to make sure the settings are correct
Testing Server Settings
- Select PHP FileMaker as your server model (or PHP FileMakerFX if using FX.php)
- Select FTP as the Access, your FTP settings should already be there
- Important Step: for the Testing Server URL Prefix enter the URL to your sub folder on the site. It will likely suggest a URL for you that includes "/httpdocs/" in it, that must be removed. the URL I use here is the same as the one on the local site: "http://mpetrov.fmgateway.com/HelloWorld/"
- Confirm all your settings and click "Ok"
Preparing the Site and Installing an API
- Make sure your new site is selected in the Files area of Dreamweaver
- Right click in that area on the site folder and choose New File, name it "index.php"
- Double click on index.php to open it
- Now using the Commands menu, choose "Install PHP API" (or "Install FX.PHP")
- In the dialog that comes up, choose Server 9 as your server version (no dialog will come up for FX.php)
- Your Files area should now include a new FileMaker folder and a FileMaker.php file (or just the FX folder for FX.php users)
- Select the FileMaker folder, right click, and choose "put" (wait for the files to be uploaded to FMGateway)
- Select the FileMaker.php file, right click, and choose "put" (wait for the file to be uploaded to FMGateway)
You now have the API installed within your site and are ready to start making database connections.
Testing the URL Prefix
To test if your URL Prefix was set correctly, which is the most common configuration mistake - it is best to try and preview one of your pages in a browser.
- Make sure index.php is still open
- In Design view type in "Hello World"
- Save the page
- Use the Preview in Browser (F12 on most systems) dreamweaver option to let Dreamweaver upload that page and open it in a browser
- The page with "Hello World" should come up, and the URL should be pointing to fmgateway.com
- If you get a 404 File Not Found, then try changing the URL in the browser until the page comes up
- Now take the changed URL and place it back in the Testing Server settings and your Local Settings (removing index.php from it)
- Make sure it is now correct by using Preview in Browser again and making sure the page comes up with no URL changes
Creating the Database Connection
- Find the Databases tab under the Application area of Dreamweaver
- Click the "+" button and select "FileMaker Connection"
- In the connection name enter "MyDatabase" or any other more descriptive name for your database that should already be uploaded and opened on the FMGateway server.
- In the FileMaker Server field enter your subdomain at FMGateway, I used "mpetrov.fmgateway.com"
- Enter your user name and password
- Click "Select..." next to the Database field
- A list of databases should come up, if you have an error then please take a look at the FMStudio Troubleshooting article for hints on how to solve it.
- Important Step If your database(s) don't show up on the list you may not have set them for network sharing. If you get an error message that says "Connected to server but login failed", check you database(s) for network sharing. Open Filemaker and open the database(s) that will go on the server. Select FILE - SHARING - FILEMAKER NETWORK and set network sharing to ON. Close your database(s) and reload them through the site administration page: http://c01.fmgateway.com/db_admin/index.php. Once this is completed you can return to this section "Creating the Database Connection" and continue with the setup process.
- Once you select your database, confirm the database selection dialog by clicking "Ok"
Uploading the Connections Folder
Now that you have your database added, you need to upload the new Connections folder to FMGateway and then your work with FMStudio can begin!
- Right click on the newly created Connections folder in Dreamweaver and choose "put"
- Any database setting changes that you make such as a new user name and password, you must repeat this step