Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7860323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:14:38+00:00 2026-06-02T22:14:38+00:00

I am creating a directory and I am getting the error Warning: chmod() [function.chmod]:

  • 0

I am creating a directory and I am getting the error

Warning: chmod() [function.chmod]: No such file or directory in /home/www/public_html/console/pubs-add.php on line 104

The php file that is running the code is in www/console and the directory that I am trying to create is in www/images/gallery.

I have tried many variations of setting the path such as ../images/gallery or home/www but nothing seesm to work

define("PATH", "/www/images/gallery");

$dir = 'a1234';

$targetfilename = PATH . '/' . $dir;

if (!is_file($dir) && !is_dir($dir)) {
    mkdir($dir); //create the directory
    chmod($targetfilename, 0777); //make it writable
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T22:14:40+00:00Added an answer on June 2, 2026 at 10:14 pm

    You mkdir command just uses $dir, which is just ‘a1234’ (in the current working directory). This will fail (and make the chmod fail too).

    The solution: you probably want to prefix $dir with PATH…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this error with GT.M: %GTM-E-GDINVALID, Unrecognized Global Directory file format: /home/blah/gt.m/example/mumps.gld,
I am getting the following error creating a new project after installing Windows Azure
My function is having problems creating and copying the contents to the new directory
I am creating a directory of sorts with members and their profiles. I'm using
I'm creating a gem which has several scripts in the bin directory the utility
I am creating an application were I need to scan a directory hive to
When creating gems, I often have a directory structure like this: |--lib |-- helpers.rb
I'm write installer for my web site. Installer creating application pool, virtual directory and
I just installed VCSCommand and I'm getting an error of No suitable plugin whenever
I am creating a simple Prism 2.1 demo that uses the 'directory search' approach

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.