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

136
Vistas
PHP Unable to create directory

I am running PHP 7.2 on an Ubuntu 18.04 server. I am trying to have a PHP script create a directory, but this is failing for some reason, and I am unable to figure out why. The permissions to the script are 777 and to the folders it is attempting to write to 705.

I have tried chowning the directory to the nobody group and this still does not work. Here is the code I am trying to make the directory:

if (!file_exists($sharexdir)) {
    mkdir($sharexdir, 0705, true);
    copy($_POST['type'].'/index.html', $sharexdir.'index.html');
}

I have added the following to test:

if(!mkdir('./img/12345/54321/', 0705, true)) {
    echo 'Couldnt create folder';
}
if (!file_exists($sharexdir)) {
    echo 'No exist';
}

I receive a Couldn't create folder and No Exist reply on POST

over 4 years ago · Santiago Trujillo
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