My PHP code runs on windows and have the following function to create file on Linux-server connected through Windows-Exchange by IP Address (172.12.20.10).
I almost done, permission and all other important things, but still the file is not created...Why?
public function demo()
{
$fileName='aa.json';
$location= base_url()."test/folder";
$Thispath = str_replace('\\', '/',$location).'/';
$ThisFile = $Thispath.$fileName;
$dir = '\\172.12.20.10\exchange';
copy($ThisFile, $dir.$fileName);
if ( !file_exists($ThisFile) ) {
echo 'no file';
}else{
echo 'file exists';
file_put_contents ($dir.'/hallo.txt', 'test File');
}
}
From the above code Either the aa.json is not copied OR the hallo.txt file is not created in the exchange folder on linux!