1
I’m trying to create a folder in a network mapping but am not succeeding
<?php
if(isset($_POST["databse"]) && isset($_POST["nomecli"])){
$database = 'C:/xampp/htdocs/criarbase/'.$_POST["databse"];
$namecli = $_POST["nomecli"];
$caminho = 'Z:/Bases/'.$namecli;
$destino = $caminho.'/'.$namecli.'.zip';
if(is_dir($caminho)){
echo 'Pasta existe';
}else{
if(mkdir($caminho, 0755, true)){
print_r(error_get_last());
if (!copy($database, $destino)) {
echo "falha ao copiar $database...\n";
}else{
echo('Base enviada para servidor');
}
}
}
}
?>
if I change it to the local folder works smoothly at first I thought it could be permission on the server to create the folder, for being a win server that is saving, but I switched to a win 10, and the error remains as not found the directory
Have you tried instead of using Z: putting the ultimate path without mapping?
– Heitor Scalabrini
yes, it brings the same mistake
– Diego Carlos
Already tested this creation code on your local machine?
– Heitor Scalabrini
yes it works, perfectly, but if you pass it to the mapping or the direct path of the folder does not work, search in some places and say that it may be allowed the apache user to make changes to the network but I did not find anything that makes this release
– Diego Carlos
I’ve had this problem before, if apache is running as a windows service, go to the service properties and set the user who has access to write this remote directory.
– Jhonny Freire
Jhonny I did it this as service yes and this set the admin user for him, but still nothing
– Diego Carlos