Very good, I want to change some routes from windows to Linux, to do verifications, and in Widnows I have these that work:
$BACKUP_PATH = "C:\\xampp\\htdocs\\deimos\\vista\\backup\\backup_";
$nowtimename = date('Y-m-d',time());
$fileName = $BACKUP_PATH.'db-backup-'.$nowtimename.'-'.'.sql';
$handle = fopen($fileName,'w+');
fwrite($handle,$return);
And in Linux as it would be, because I had to put the quad against the bar in Windows, I found it messy to understand it at the beginning, or I did it wrong but it works. I do not know what to say to you, but they advised me like that and I did so, but in Linux I do not know if it's a problem with the missing bars or because, but I have this:
$BACKUP_PATH = "/var/www/html/dcmcode/deimos/vista/backup";
$nowtimename = date('Y-m-d',time());
$fileName = $BACKUP_PATH.'db-backup-'.$nowtimename.'-'.'.sql';
$handle = fopen($fileName,'w+');
fwrite($handle,$return);