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

How include php-files from another domain

Discussion in 'Plesk for Linux - 8.x and Older' started by DadRover, May 6, 2008.

  1. DadRover

    DadRover Guest

    0
     
    I have Client and at the client some domains (more than ~100). How, from one domain include php-files from another domain with php-commands "require ()" which statement includes and evaluates the specific file?
    ex:

    body of file "somefile.php" from first domen (domen1.com)
    <?php echo "Hello"; ?>

    "index.php" file second domen (domen2.com)
    <?php require ('../../domen.com/http/somefile.php');?>

    Expected result domen2.com:
    Hello
     
  2. Monica@

    Monica@ Guest

    0
     
    Hi
    Most probably you should enable the access to the PHP scripts of another virtual host by configuring open_basedir directive where the new path value is redefined. To get it work with Plesk you will need to create a separate vhost.conf file in the $HTTPD_VHOSTS_D/domain.tld/conf/ directory. The directive should be like:
    <Directory HTTPD_VHOSTS_D/domain.com/httpdocs>
    php_admin_value open_basedir "HTTPD_VHOSTS_D/domain.com/httpdocs:/tmp:/"HTTPD_VHOSTS_D/domain2.com/httpdocs
    </Directory>
    After that you should run
    /usr/local/psa/admin/sbin/websrvmng -v -a
    to apply the changes. After that the script should be accessible, try.
     
Loading...