Form Tools
Development / production server - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: Development / production server (/showthread.php?tid=441)



Development / production server - BlueRobot - Jan 15th, 2010

I have a live site using formtools and the customer wants to add log in to their forms. I thought I'd try setting it up in a work/preview server and database so as not to break the live site. I've changed the config.php to point to the new subdomain and database and changed all the domain references in the database. It doesn't work.

Here's the only clue I have "Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

Any ideas? Anyone have formtools set up in a staging / live configuration and moving back and forth?
Fixed - forgot to make the theme cache folders writeable.


RE: Development / production server - Ben - Jan 16th, 2010

Hey BlueRobot,

Glad you got it fixed.

Just in case anyone else comes across this thread, I do this for many installations - I generally work on the same site on my home PC, mac laptop and live environment. I store all work in SVN so I can just checkout the folder to whatever environment I'm on at that time. To get around the problems of paths, my "cheat" way of doing it is just to add a switch statement in my config.php file that determines the settings to use. That way I just need to change that one variable to work in the different environments. Something like this :

PHP Code:
<?php

$environment 
"pc"// "mac", "live" (or whatever)

switch ($environment)
{
  case 
"pc":
    
// enter config.php contents of PC environment here
    
break;
  case 
"mac":
    
// enter config.php contents of Mac environment here
    
break;
  case 
"live":
    
// enter config.php contents of Live environment here
    
break;


It's not 100%: things like file upload paths are still stored in the database & need to be updated manually. Kind of a drag, but I only ever update those as I need.

- Ben