I have a server where 5 sites are hosted. One of them has a system where you download a file that is in the hosting of another site, but of a same server. The file is there, but at the time of download an error appears.
If I change the path of hosting the site itself it can download the file, but when it is from another place it does not download.
The code:
$patch = 'c:\inetpub\vhosts\portalemme2.com.br\web\assets\agencia_online\pedidos\'.$pedido->link_arquivo;
try{
fopen($patch, 'r');
}
catch(Exception $e) {
var_dump($e);
}
If I change the patch it works.
Erro:
A PHP Error was encountered
Severity: Warning
Message: fopen(): open_basedir restriction in effect. File(c:\inetpub\vhosts\portalemme2.com.br\web\assets\agencia_online\pedidos54_Missa_Anglo_Indaiatuba.zip) is not within the allowed path(s): (C:/Inetpub/vhosts/matriculanglo2.com.br\;C:\Windows\Temp\)
Filename: controllers/Agencia_online.php
Line Number: 1739
Backtrace:
File: C:\Inetpub\vhosts\matriculanglo2.com.br\web\application\controllers\Agencia_online.php
Line: 1739
Function: fopen
File: C:\Inetpub\vhosts\matriculanglo2.com.br\web\index.php
Line: 293
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: fopen(c:\inetpub\vhosts\portalemme2.com.br\web\assets\agencia_online\pedidos54_Missa_Anglo_Indaiatuba.zip): failed to open stream: Operation not permitted
Filename: controllers/Agencia_online.php
Line Number: 1739
Backtrace:
File: C:\Inetpub\vhosts\matriculanglo2.com.br\web\application\controllers\Agencia_online.php
Line: 1739
Function: fopen
File: C:\Inetpub\vhosts\matriculanglo2.com.br\web\index.php
Line: 293
Function: require_once