0
I have a server where five websites are hosted. One of them has a system where you download a file that is in the hosting of another site, but of the same server. The file is there, but at the time of downloading an error appears.
If I change to the way of hosting the site itself it manages to 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\pedidos\7654_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\pedidos\7654_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
I put "None" in open_basedir in php settings and it worked! thanks
– Beatriz Sgavioli