copy file from domain to subdomain

Discussion in 'PHP' started by cnapsys, Aug 12, 2011.

  1. #1
    Hey all,
    I've been playing with this script for the last couple of hours:

    $path1 = "/var/www/vhosts/domain.com/httpdocs/new/test/test.jpg";
    $path2 = "/var/www/vhosts/domain.com/subdomains/img/httpdocs/test/test.jpg";

    if (!copy($path1, $path2)) {
    echo "failed to copy file...";
    }

    error reporting is disabled so I can't see the actual error but I'm assuming it's got something to do with permissions.

    I guess it should work if /test/ on the subdomain was set to chmod 777 but really don't wanna do that.
    What are my options?

    Any help is greatly appreciated

    c
     
    cnapsys, Aug 12, 2011 IP
  2. cnapsys

    cnapsys Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    So after digging a bit more I found out that it is an open_basedir restriction.
    Is there a way to do this without turning open_basedir off?

    I thought about having a perl script running on the server with proper permissions and then maybe call it from php???
    Not sure what the best method is or what other options are there???

    Anyone that has ever dealt with something similar... your input would be awesome

    ty for your time

    c
     
    cnapsys, Aug 30, 2011 IP