Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

134
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!