1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

PHP permissions on different vhosts

Discussion in 'Plesk for Linux - 8.x and Older' started by dtbaker, Jun 28, 2005.

  1. dtbaker

    dtbaker Basic Pleskian

    23
    57%
    Joined:
    Mar 31, 2005
    Messages:
    25
    Likes Received:
    0
    Hey all.. been pulling my hair out on this:

    Scenerio:

    have two domains on one server:
    /home/httpd/vhosts/domain1.com/httpdocs
    /home/httpd/vhosts/domain2.com/httpdocs

    domain1.com runs a php script which needs access to other domains 'httpdocs' directories.

    eg: /home/httpd/vhosts/domain1.com/httpdocs/edit_me.php

    PHP:
    <?php

    $domain_name 
    "foo.com";
    $site_root "../../../$domain_name/httpdocs";

    if(( 
    $fd fopen"$site_root/welcome/site_pages.inc""r" )) == NULL ){
      echo 
    "Could not open: $site_root/welcome/site_pages.inc";
      exit;
    }

    etc...
    ?>

    here's where i have a brain fart:

    if i copy /home/httpd/vhosts/domain1.com/httpdocs/edit_me.php over to /home/httpd/vhosts/domain2.com/httpdocs/edit_me.php

    http://domain1.com/edit_me.php works fine... but running
    http://domain2.com/edit_me.php doesn't..

    I do not get a fopen error from php or from the echo "Could not open: $site_root/welcome/site_pages.inc"; part.. the script just.. stops ?

    I have changed file permissions under both domains and the accounts have full read access onto those files...

    I'm left with wondering if there is a chroot environment setup for domain2 and not for domain1...

    this is where I need ur help... how do i check if a domain hosted on this plesk server is running in a chroot..?

    and how do i disable a chroot?

    thanks heaps..

    Dave.
     
  2. Whistler

    Whistler Guest

    0
     
    You don't write what error message your'e getting - would help a lot!

    But I guess your problem should be found in your open_basedir settings?

    Your PHP for domain2 should be restricted into only includeing files from within it's own path. As should by the way also the php runned from domain1.
     
  3. dtbaker

    dtbaker Basic Pleskian

    23
    57%
    Joined:
    Mar 31, 2005
    Messages:
    25
    Likes Received:
    0
    Sorry for not making it clearer:

    > I do not get a fopen error from php or from the echo "Could not open: $site_root/welcome/site_pages.inc"; part.. the script just.. stops ?

    Yes there were 'no' error messages, even after telling /etc/php.ini to display everything,

    The script just stopped executing when it tried to open the file.

    open_basedir is not currently set to anything in /etc/php.ini

    i cant find any site or vhost specefic php configuration files.... any idea where they reside?

    cheers heaps
    dave
     
  4. dtbaker

    dtbaker Basic Pleskian

    23
    57%
    Joined:
    Mar 31, 2005
    Messages:
    25
    Likes Received:
    0
    Found it:

    /home/httpd/vhosts/domain1.com/conf/httpd.include

    has:

    #php_admin_value open_basedir "/home/httpd/vhosts/domain1.com/httpdocs:/tmp"

    but in domain2.com's httpd.include this option is not commented out.

    thx
    dave.
     
  5. Whistler

    Whistler Guest

    0
     
    Dosen't matter what the open_basedir setting in your php.ini says - what is specified in your httpd.conf setting?

    Put:

    Code:
    <?php phpinfo(); ?>
    in a .php file in domain2 and see what the open_basedir setting is (local value)...
     
Loading...