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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jerry

    #1

    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
  • James Smith

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

    Jerry wrote:
    [color=blue]
    >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
    >
    >[/color]

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



    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.

    Comment

    • Chris Hope

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

      Jerry wrote:
      [color=blue]
      > 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?[/color]

      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/

      Comment

      • Michael Vilain

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

        In article <e7lrg0hevdd9lg acrg358ia7ut9p4 5qd42@4ax.com>,
        Jerry <submitstuff@ly cos.com> wrote:
        [color=blue]
        > 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?[/color]

        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



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



        Comment

        Working...