Making a PHP install script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lasmit

    Making a PHP install script

    Over a number of month's I've slowly built up a nice CMS with central
    interface, each client has their own site eg, www.example1.com,
    www.example2.com and there is a central site where users can login and
    update their site.

    I'm now looking to automate the process of setting up new sites and so
    creating a script to do the database stuff that needs to be done each
    time, and perhaps even some of the file copying.

    Was just looking for some general advice before I plough in, does
    anyone have any particular best practice they could recommend? Or
    common pitfalls to avoid?

    Should be quite straightforward but not having done it before thought
    it'd be good to get some advice from the experts.

    Thanks in advance

    Lewis

  • shimmyshack

    #2
    Re: Making a PHP install script

    On Apr 20, 9:29 am, lasmit <lewisthesm...@ googlemail.comw rote:
    Over a number of month's I've slowly built up a nice CMS with central
    interface, each client has their own site eg,www.example1.com,www.example2.comand there is a central site where users can login and
    update their site.
    >
    I'm now looking to automate the process of setting up new sites and so
    creating a script to do the database stuff that needs to be done each
    time, and perhaps even some of the file copying.
    >
    Was just looking for some general advice before I plough in, does
    anyone have any particular best practice they could recommend? Or
    common pitfalls to avoid?
    >
    Should be quite straightforward but not having done it before thought
    it'd be good to get some advice from the experts.
    >
    Thanks in advance
    >
    Lewis
    just a few thoughts
    the only consistently troublesome thing (with some install scripts)
    that I have are, assumptions about the path, language, and use of
    $_SERVER['document_root'].
    You might like to consider people on windows and change the options
    for mail() to allow them to use local/remote smtp instead. Also people
    often have trouble with DNS lookups, and can also be behind proxies,
    and I assume you have already used best practise in these areas, as
    well as things like i8ln. Some of your CMS might use functionailty
    from modules like imagemagick which might not be created equal for win/
    lin.
    I use Apache2.2.4 Dynamicically Configured Mass Virtual Hosting on
    windows and linux, which means that $_SERVER['DOCUMENT_ROOT'] is
    sometimes not set
    correctly on the machine, with the IP appearing instead of the
    servername.
    You can get round this using something like $rootPath=
    str_replace( $_SERVER['SERVER_ADDR'], $_SERVER['SERVER_NAME'],
    $_SERVER['DOCUMENT_ROOT'] );
    Some of the above changes might require changes to your app code as
    well as the install script, but the changes will be worth it!

    Comment

    Working...