La cuestion esta aca:
$gestor=fopen($path1,"w+");
Fijate lo de w+:
http://php.net/manual/en/function.fopen.php Cita: 'w+' Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.
Usa: 'a'
así: $gestor=fopen($path1,"a");