You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Ron Addie <ad...@usq.edu.au> on 2006/08/08 08:36:57 UTC

Re: How to create a directory in red hat linux using php

ashok kumar wrote:

> Hi,
>  
> Iam having PHP working with Apache on RedHat Linux 9.
> From PHP Iam trying to create a directory using mkdir("/etc/owndir"); 
> but iam getting the error *warning: mkdir() failed (Permission 
> denied)  in  /var/www/html/dircheck.php on line 4.*
> ** 
> please do help me in creating a directory.

This is something which needs to be done as root. You could
switch to root using the su command and create the directory
in a console. You would need to change the permissions
on the directory as well. The script would then probably work.

Alternatively, you could change the permissions on the directory
/etc. But this would open up /etc for undesirable access by
other users.

You should think carefully about the reason the directory is
needed. In most cases it is best if directories are created by
the web server as needed, because then it owns the directory in
question and would have the access it needs.

Ron.

>  
> Regards
> Ashok.V
>
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail Beta. 
> <http://us.rd.yahoo.com/evt=42297/*http://advision.webevents.yahoo.com/handraisers> 




Re: How to create a directory in red hat linux using php

Posted by ashok kumar <va...@yahoo.com>.
Thankq Ron,
   Iam able to create the directory after changing the root permissions.
   
  Regards
Ashok.V

Ron Addie <ad...@usq.edu.au> wrote:
  ashok kumar wrote:     Hi,
   
  Iam having PHP working with Apache on RedHat Linux 9.
  From PHP Iam trying to create a directory using mkdir("/etc/owndir"); but iam getting the error warning: mkdir() failed (Permission denied)  in  /var/www/html/dircheck.php on line 4.
   
  please do help me in creating a directory.
This is something which needs to be done as root. You could
switch to root using the su command and create the directory
in a console. You would need to change the permissions
on the directory as well. The script would then probably work.

Alternatively, you could change the permissions on the directory
/etc. But this would open up /etc for undesirable access by
other users.

You should think carefully about the reason the directory is
needed. In most cases it is best if directories are created by
the web server as needed, because then it owns the directory in
question and would have the access it needs.

Ron.
     
  Regards
  Ashok.V

  
  
---------------------------------
  Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail Beta. 


 		
---------------------------------
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail Beta.