Jump to content

Moving Generated Site to Remote Server


This topic is 5020 days old. Please don't post here. Open a new topic instead.

Recommended Posts

How to move a PHP Site Assistant generated site from a localhost to a remote server

The above questions took me a number of hours to solve and since it's seems that I'm not the only person who has had this difficult, I thought I would post the solution that worked for me.

Problem:) You have setup FM Server on your development machine and used it to host your FileMaker file(s). Using the PHP Site Assistant, you connect to a FileMaker database and generate a site that is also hosted locally by Apache or IIS. Everything works great so you move the site and databases to remote servers. And, the home page comes up, but other than that, nothings works.

Solution: The reason nothing works is because the site is looking for the database on "localhost" and it's no longer there. Why? When the PHP Site Assistant generates the site it neglects to include the FileMaker.php file and the FileMaker directory. To locate these files, go to your FileMaker Server directory -> Web Publishing -> FM_API_for_PHP_Standalone.zip Unzip the archive and place the FileMaker.php and FileMaker directory at the root level of your generated site.

To set the location of the database server, go to FileMaker/conf/filemaker-api.php and open in a text editor or website management program like Dreamweaver. Change line 29 to include the IP address or domain of your FileMaker Server:

This is the default configuration which you should edit for your server:

$__FM_CONFIG['hostspec'] = 'http://127.0.0.1';

when you are done it might look something like this with a domain:

$__FM_CONFIG['hostspec'] = 'my.domain.com';

or like this with and IP address.

$__FM_CONFIG['hostspec'] = 'xxx.xxx.xxx.xxx';

The "http://" is apparently superfluous but you can specify the port if needed by including a colon adn the port number, e.g. 'my.domain.com:80'

Save the filemaker-api.php file and upload both the FileMaker.php and FileMaker directory to the root level of your PHP Site Assistant generated site. The site should now properly access the database server at the address you specified.

Link to comment
Share on other sites

  • 1 month later...

One additional error that you might encounter in moving a PHP Site Assistant generated site to a remote server is that you get an error that looks like the following:

Warning: session_start() [function.session-start]:) Cannot send session cookie - headers already sent by (output started at D:inetpubvhostsmydomain.commygeneratedsitehome.php:2) in D:inetpubvhostsmydomain.commygeneratedsitehome.php on line 10

To solve this you need to remove the following text from all pages, starting with the home.php page.

You can use Dreamweaver to do a "Replace All" searching on Source Code and replacing with nothing to remove this "header" so that each page begins with the "<?php" tag

Link to comment
Share on other sites

This topic is 5020 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.