Nov 8, 2009

Permission Denied In Creating A Directory - mkdir()

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

Permission Denied In Creating A Directory - mkdir()

whistle
QUOTE
Warning: mkdir(/home/whistle/public_html/see/seeto): Permission denied in /home/whistle/public_html/see/config.php on line 56


My web hosting is on the astahost. The absolute path of my php script is "(/home/whistle/public_html/see". When I try to create a directory named "seeto", the error message about permission denied is displayed. The same script I tried on another web hosting server "Lycos", it works perfectly.

Can anyone tell me what is wrong with it? Or anything I should notice more? Thanks.

CODE
<?php
if (mkdir("/home/whistle/public_html/see/seeto", "0777")) {
   printf("New directory created");
} else {
   printf("Couldn't create directory");
}
?>


That's my php script for testing the directory creation. Of course, the same error message is displaied as following:

Warning: mkdir(/home/whistle/public_html/see/seeto): Permission denied in /home/whistle/public_html/see/test.php on line 2
Couldn't create directory <=== This is not a part of the error message.
<=== It is my prompt message in the else block.

It seems that the php script does not get permission for create a directory or a file. What should I do to open the permission for my PHP scripts.

 

 

 


Comment/Reply (w/o sign-up)

Klass
do you have execute permission set on the script/directory your running the script from?

Comment/Reply (w/o sign-up)

whistle
QUOTE (Klass @ Aug 4 2005, 08:59 PM)
do you have execute permission set on the script/directory your running the script from?
*


Ah~~~ I don't wether I have the execute permission set on the script/directory or not.

The permission of the directory "/home/whistle/public_html/see" is 755. Is it right? But I don't know the permission of the directory "/home/whistle/public_html/see/seeto" I want to create, because it is never created. biggrin.gif Just joking.

Comment/Reply (w/o sign-up)

Klass
why not make full permission on the see directory and the script that is running if it is not in the see directory.

if the script runs then you know it is a permission/chmod issue, if not maybe check the logs and see why

Comment/Reply (w/o sign-up)

Hercco
I tested and there is no problem using php mkdir at panda, so its definitely your file permissions.

Comment/Reply (w/o sign-up)

whistle
QUOTE
why not make full permission on the see directory and the script that is running if it is not in the see directory.

if the script runs then you know it is a permission/chmod issue, if not maybe check the logs and see why


QUOTE (Hercco @ Aug 5 2005, 08:14 PM)
I tested and there is no problem using php mkdir at panda, so its definitely your file permissions.
*


Yes, you are right. After I made full permission, the mkdir worked. It means that the parent directionary should have the permission, at least full permission mush work.

Comment/Reply (w/o sign-up)

FeedBacker
able to upload to public_ftp but can\\
Permission Denied In Creating A Directory

I am able to upload my files on the servers public_ftp/incoming folder but am not able to open the same directory to read or download the files.The error which I'm getting is permission denied in /home/jahp/public_html/u_upload.Php I'm on linux hosting and the drive path I'm using is relative to the u_upload script.Is there any way I could change the permission of the directories.

Will be greatful if someone helps.

Thanku .





-reply by jahajee

Comment/Reply (w/o sign-up)

(G)
Permission Denied In Creating A Directory - mkdir()
Permission Denied In Creating A Directory

see your apache error logs first. Then ensure the folder in which your creating files have execute permision for your webserver.


Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : permission, denied, creating, directory, mkdir

  1. Creating A Template Engine
    General Advice? (1)
  2. Unofficial Astahosted Members Directory
    (60)
    I wanted to grab a look at how the other members' sites looked. Searching through the forums is
    good enough to retrieve the address of their websites. However, quite a few of the links are dead.
    So, I decided to make a script to do this job for me. Here's a screenshot of the directory
    listing process. Astahost Directory Lister ....
  3. Login Script
    PHP Help #3 - Need help creating one (5)
    It turns out that the authentication script that I copied from
    http://www.php-mysql-tutorial.com/user-aut...on/database.php doesn't work even when it is left
    unchanged. What a crappy piece of code. Now I am trying to build by own login script from scratch.
    I already have a little knowledge on how to do this (connecting, echoing, retrieving) but I need
    some more examples and/or tips. I know what I need and maybe this could help you out: Note: Green
    items are fixed. No duplicate username in MySQL Database Authorized users only. I have to
    authorize each....
  4. Xgrid With Php
    Creating a script to post a blender file to Xgrid using PHP (0)
    I am doing pre planning for the blenderxgrid.com script. I was originally going to do this with
    PERL, but elected against it. Eventually I'll be moving the site off astahost and replacing it
    with a website hosted on the same machine as the xgrid controller. I am setting up a test version
    on my latop using OSX's apache server, MySQL, and PHP on a localhost config. Here is my step
    list for the script: ------------------------------------- Form: (within Xoops CMS, so user will
    have to be logged in) Username Password (where they can upload the .blend file....
  5. Help: Php + GD - Creating A Progress Bar
    Creating A Progress Bar (5)
    I've recently been trying to read up on using PHP and GD to create PNG's on the fly.
    I've been doing so in hopes that I will be able to learn how to compile a script that will
    output an image of a progress bar with certain attributes based on the url that called it (which
    will be accessed predominately from a forum, so it must be able to be coded as standard BBC). These
    attributes would include the bar's title (based on the event mentioned in the url) printed
    centered and right above the meter, a background image (to hold the meter), the meter (the ....
  6. How Do I Create And Write To Files?
    creating, writing, deleting files (4)
    Hi, Can someone please tell me how to create files and write to them in PHP. I just want to create
    a simple file containing text, and then be able to read it or update it. Thanks Alfie....
  7. Free software for creating PHP sites
    (17)
    This is good for those who doesnt have knowledge bout PHP they are totally free here are my 2 know
    free web portal system Postnuke -> www.postnuke.com and PHPnuke -> www.phpnuke.org /tongue.gif"
    style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" />....

    1. Looking for permission, denied, creating, directory, mkdir

See Also,

*SIMILAR VIDEOS*
Searching Video's for permission, denied, creating, directory, mkdir
advertisement



Permission Denied In Creating A Directory - mkdir()

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com