• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

How include php-files from another domain

D

DadRover

Guest
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
 
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.
 
Back
Top