Jump to content
xisto Community
Sign in to follow this  
whistle

Permission Denied In Creating A Directory mkdir()

Recommended Posts

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 Xisto. 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.

<?phpif (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.

Share this post


Link to post
Share on other sites

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

<{POST_SNAPBACK}>


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. :D Just joking.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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


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

<{POST_SNAPBACK}>


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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
an error occured when i use my php file.Permission Denied In Creating A Directory

can anyone suggest me a better and easy solution to fix the problem. it is only in linux hosting. I have tried other hosting also but this type of problem occured in linux hosting

Warning: fopen(ids.Txt) [function.Fopen]: failed to open stream: Permission denied in /home/neworkut/public_html/testing.Php on line 56Warning: fwrite(): supplied argument is not a valid stream resource in /home/neworkut/public_html/testing.Php on line 56Warning: fclose(): supplied argument is not a valid stream resource in /home/neworkut/public_html/testing.Php on line 56

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.