creating directories

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
when I create directory with mkdir() in PHP script I can't create any  
more directory inside that script

I try to aplay 0777 to mkdir and chmod with no success

I think the problem is with safe_mod and wrong uid

how to solve this problem?

Thank you

Re: creating directories

I try webadmin.php - a simple Web-based file manager by Daniel Wacker
and i get the same problem

directories created by FTP have owner: "usernmame" group: ftponly
directories created by script has owner: wwwrun group: www

when I create directory by script, I have no privilegies to vreate  
another directory inside the new directory

Please help!

Re: creating directories

Quoted text here. Click to load it

Use your FTP program to set the permissions on the target directory to
777. Then, your PHP script should be able to create files and
directories inside. If your FTP program doesn't have a
chmod/permission option, download WS_FTP.



Re: creating directories

s wrote:
Quoted text here. Click to load it

I did that on first directory I created in FTP

If I create directory by script I can't set chmod by FTP because it's  
diferrent uid.

I'm thinking of using ftp_mkdir()

can I set ftp_chmod() on directories or only on files ?

Re: creating directories

Quoted text here. Click to load it

         What you have to understand is that your PHP scripts are
executing under the same userid as the webserver.  Nothing you can
do is going to change that or allow you to create files owned by
your username from a PHP script on that server.  I assume you are in
a 'shared hosting' environment and don't have any immediate control
over the userid/group  used by the web server.

         Your only option is to use FTP and manually fix stuff
later; OR, your hosting provider may support PERL execution through
CGI scripts and may have 'suexec' enabled.  That would allow a PERL
script to run under your userid/group.  Then, from PHP you could
invoked that PERL script to create directories that would be owned
by you.

         Hope this helps.

John Murtari                              Software Workshop Inc.
jmurtari@following domain 315.635-1968(x-211)  "TheBook.Com" (TM)

Site Timeline