Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

135
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda