Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

171
Vistas
open file and download does not work in ubuntu

i complete my code on windows xampp to download text(or other file) file and its work good but when i upload the code on ubuntu server its does not work can you help me plz

$file = "$username.rsc";
$txt = fopen($file, "w") or die("Unable to open file!");
fwrite($txt,
"{
anything
}

");
fclose($txt);

header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename='.basename($file));
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
  ob_clean();
    flush();
header('Content-Length: ' . filesize($file));
header("Content-Type: text/plain");
readfile($file);

the response on ubuntu is Unable to open file!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This sounds like a permissions issue. Make sure that your Apache user and group has access to the file and directory that you are trying to modify.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda