469,953 Members | 2,257 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,953 developers. It's quick & easy.

PLEASE HELP: How to create files and folders running my script????

Hi All:

Is there any way I can get my script to be able to create and CHMOD
folders and files???
I always get the following error:

mkdir(TESTDIR): Permission denied in /usr/www/users...

Is there a way I can enable the script to do all that by placing a
..htaccess file which contains some permissive directives?

Thanks
Jerry
Jul 17 '05 #1
3 1969
Jerry wrote:
Hi All:

Is there any way I can get my script to be able to create and CHMOD
folders and files???
I always get the following error:

mkdir(TESTDIR): Permission denied in /usr/www/users...

Is there a way I can enable the script to do all that by placing a
.htaccess file which contains some permissive directives?

Thanks
Jerry


mkdir(TESTDIR, 777); * replace 777 with the correct permissions.

http://www.php.net/manual/en/function.mkdir.php

I think your problem would be more to do with the permissions you are trying to create the folder in. If it's Apache on linux, the user "nobody" will need correct permissions, to be able to write to the directory. You will need to do a CHMOD on the directory. .htaccess file will not fix this as pache doesn't even have the right to write.

J.
Jul 17 '05 #2
Jerry wrote:
Is there any way I can get my script to be able to create and CHMOD
folders and files???
I always get the following error:

mkdir(TESTDIR): Permission denied in /usr/www/users...

Is there a way I can enable the script to do all that by placing a
.htaccess file which contains some permissive directives?


You need to change the permissions of the directory that you want to make
files or directories in to be writeable by all users (ie 0777 or rwxrxwrxw)

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Jul 17 '05 #3
In article <e7********************************@4ax.com>,
Jerry <su*********@lycos.com> wrote:
Hi All:

Is there any way I can get my script to be able to create and CHMOD
folders and files???
I always get the following error:

mkdir(TESTDIR): Permission denied in /usr/www/users...

Is there a way I can enable the script to do all that by placing a
.htaccess file which contains some permissive directives?


Nope, apache's web server doesn't do this. Sorry.

You're running as the web server UID and don't have permissions to write
in that directory. Fix the directory's permissions accordingly.

Or create a perl/php script and run it as _your_ UID using cgiwrap

http://cgiwrap.sourceforge.net/

If you don't have root or can't get your webmaster to setup cgiwrap for
you, you'll have to rethink your approach.

--
DeeDee, don't press that button! DeeDee! NO! Dee...

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Tank | last post: by
13 posts views Thread by Siegfried Heintze | last post: by
5 posts views Thread by Tiraman | last post: by
2 posts views Thread by Good Man | last post: by
7 posts views Thread by rn5a | last post: by
8 posts views Thread by inFocus | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.