Include file on another domain.

Discussion in 'PHP' started by Kain, Jun 12, 2012.

  1. #1
    I'm writing a php script but I want to keep the functions in a file on a different domain on the same server.

    I cant use include 'http://domain.com/functions.php'; as it is a security risk and is disabled on the server.

    Is there any way of safely including the file anywhere outside the account that it is hosted on in the same server?

    I have full root access to the server.
     
    Kain, Jun 12, 2012 IP
  2. ironcladservers

    ironcladservers Well-Known Member

    Messages:
    389
    Likes Received:
    20
    Best Answers:
    4
    Trophy Points:
    115
    #2
    Just use a file include instead of URL include, pointing to the full path (ie: /home/username/public_html/site/script.php)

    If you get any open_basedir warnings just disable it for that domain or create a custom php.ini config to include that path in the accounts permitted paths.
     
    ironcladservers, Jun 12, 2012 IP