PHP SSI Includes

Discussion in 'PHP' started by agent14, Aug 18, 2006.

  1. #1
    Hi. I know how to perform SSI includes however I was wondering if there was a solution to prevent errors from occuring if you switch web hosts.

    For example: your current SSI is hosted on /linux/var/shared/username/domain.com/SSI.php
    And your new hosts has your files in /var/username/domain.com/SSI.php

    An error would occur in the SSI includes/requires. How do I get around this? Thanks.
     
    agent14, Aug 18, 2006 IP
  2. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #2
    change the path in your config from
    /linux/var/shared/username/domain.com/SSI.php
    to
    /var/username/domain.com/SSI.php

    there are other options depending on exact configuraton and precise use of SSI

    for example if the script calling the text modul is IN same folder as the text module
    a path config like

    $folder = '.';
    can be used instead of
    /var/username/domain.com/

    my PHP include uses relative paths and hence looks like

    ... include('../newsfeeds/zfeeder.php'); ...

    I am sure others have more options and solutions for you
     
    hans, Aug 18, 2006 IP
  3. agent14

    agent14 Well-Known Member

    Messages:
    71
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    113
    #3
    Thanks but I already knew that I had to change the location if I use that method...I was wondering because of the Co-Op code uses an include like this:
    <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network_352.php');
    echo $ad_network;
    ?>

    The code: ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../'); has left me wondering if I can switch paths easier...
     
    agent14, Aug 18, 2006 IP