Astahost.com   Mar 22, 2010
Open Discussion & Free Web Hosting > Astahost > Hosted Members Support > Misc. Issues with no other forum

Help Needed- Php Mkdir() - PHP mkdir() - Permission denied

free web hosting
Open Discussion & Free Web Hosting > Astahost > Hosted Members Support > Misc. Issues with no other forum

Help Needed- Php Mkdir() - PHP mkdir() - Permission denied

signatureimage
My PHP script, running on astahost.com,
calls the PHP function mkdir() to create a new directory.

This works on my home development-server on Microsoft Windows with Apache.

This works on my home test-server on Linux Fedora with Apache.

This does NOT work on astahost.com: "Permission denied".

According to the CPanel File Manager, the properties of
the parent directory are: permissions 755:
User: Read-Write-Execute
Group: Read-Execute
World: Read-Execute

Any idea, administrators?

Comment/Reply (w/o sign-up)

overture
it seems to be a CHMOD issue, is the parent directory the default (public_html) or one that you have made. you could always try setting the default dir to 777. or this could be a temporary problem as a result of the down time to astahost, as some of us did have problems logging in cpanel and the like.

what is the code you are using?

although it does seem most likely an issue with the CHMOD settings although 755 should allow creating of folders shouldn't it?

lets see what the mods or admins say. they are smarter than me lol.

Comment/Reply (w/o sign-up)

signatureimage
Dear overture,

You asked for the code:
CODE
//---------------------------------------------------------------------------------------------------------------------------------------------------
// Called by F_Create_Folder()
function F_Make_Folder($P_foldername)
    {
    if (file_exists('../'.$P_foldername))
 {
 return "OK";
 }
    else
 {
 if ($rc = mkdir('../'.$P_foldername))
     {
     return "OK";
     }
 else
     {
     return "KO";
     }
 }    
    }
//---------------------------------------------------------------------------------------------------------------------------------------------------


Note: the if ($rc = mkdir('../'.$P_foldername)) is not a comparison, it is an assignment, whose boolean value is tested.
Therefore, only one equal sign is used...



Dear overture,

Your suggestion to modify the permissions to 777 will temporarily be tried.

 

 

 


Comment/Reply (w/o sign-up)

marijnnn
775 would be enough though.

Comment/Reply (w/o sign-up)

signatureimage
Dear marijnnn,

Have tried 775: was not enough.

Have tried 777: works.

But I agree with you: 777 is not safe !

Comment/Reply (w/o sign-up)

marijnnn
you could chmod your files by php tot 777 when you need them and then change em back to 775 or even less? smile.gif
it's a lot of overhead though :s

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)




See Also,

*SIMILAR VIDEOS*
Searching Video's for needed, php, mkdir, php, mkdir, permission, denied
advertisement




Help Needed- Php Mkdir() - PHP mkdir() - Permission denied

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



Creative Commons License