no permission to access a folder my script created on a server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mague
    New Member
    • May 2007
    • 137

    no permission to access a folder my script created on a server

    Hey,

    I am using a server of my friends, and i created a directory through php with exec("mkdir $dir") these are now imposible to get into and delete. (well not impsobile, impossible for a kid my age who doesnt no what they have done) It says permission denied i use smartftp and that covers everything i tihnk.has this happened to anyone before and know how to fix it!

    Thanks alot
    mague
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Mague.

    Changed thread title to better describe the problem (did you know that threads whose titles contain phrases such as, 'problem' actually get FEWER responses?).

    First off, you'll want to use mkdir(), as then you're less likely to have these permissions errors.

    You can try resetting the permissions of the folder to something more agreeable by calling:[code=php]chmod('/path/to/dir', 0755);[/code]

    Note that the leading zero on '0755' is important.

    If you get a permission denied error when you attempt to do that, you'll need to log into your server with root permissions and delete the folder. This may involve a call to your hosting provider's support team.

    For more info on what's going on, check out this article.

    Comment

    • Mague
      New Member
      • May 2007
      • 137

      #3
      Originally posted by Mague
      Hey,

      I am using a server of my friends, and i created a directory through php with exec("mkdir $dir") these are now imposible to get into and delete. (well not impsobile, impossible for a kid my age who doesnt no what they have done) It says permission denied i use smartftp and that covers everything i tihnk.has this happened to anyone before and know how to fix it!

      Thanks alot
      mague
      thanks i used the root user just if your intrested

      Comment

      • Mague
        New Member
        • May 2007
        • 137

        #4
        Mkdir permission problems

        Hey,

        i have a server, i do not have root user rights. When i use mkdir("$dir") it make the dir and the chmod is what i like it but then i cannot access it. When i try to go to it through smart ftp i get this error

        [21:37:21] CWD /htdocs/graphica/testing
        [21:37:21] 550 /htdocs/graphica/testing: Permission denied

        I have used an online ftp thing called http://ftplive.com/ftp.php

        name permissions user group date
        images drwxr-xr-x flume flume Aug 26 06:38
        testing drw-rw-rw- apache flume Aug 26 11:25

        If there are anyidea please post them

        thanks heaps
        Mague
        ps. 13 years old so be nice

        Comment

        • ak1dnar
          Recognized Expert Top Contributor
          • Jan 2007
          • 1584

          #5
          I'll give you a simple advice when using FTP tools big boy.
          Never use any tool that you cannot make a trust on it. They might stole up your usernames passwords.Its my opinion.

          How about using FileZilla and Feel the Freedom of the OpenSource Products.

          Comment

          • pbmods
            Recognized Expert Expert
            • Apr 2007
            • 5821

            #6
            Merged duplicate threads.

            Comment

            • Mague
              New Member
              • May 2007
              • 137

              #7
              Thanks for the advise but this still doesn't solve my problem, this has nothing to do with my ftp program the php script creates the folder but the folder has no permissions in it. Thanks for the advise though i will stay with my SmartFTP. I will be happy if someone could help me with the problem with MKDIR() thanks

              Thanks alot
              Mague

              Comment

              • pbmods
                Recognized Expert Expert
                • Apr 2007
                • 5821

                #8
                Heya, Mague.

                It is unusual for PHP not to have permissions to access a folder that it has just created. This may be a symptom something funky going on in your server's Users/groups setup.

                Try putting this before your mkdir() call:
                [code=php]
                umask(0022);
                [/code]

                This will set the permissions mask to 0022, which means that any files or folders you create will start out with 0755 permissions.

                Comment

                • Mague
                  New Member
                  • May 2007
                  • 137

                  #9
                  Originally posted by pbmods
                  Heya, Mague.

                  It is unusual for PHP not to have permissions to access a folder that it has just created. This may be a symptom something funky going on in your server's Users/groups setup.

                  Try putting this before your mkdir() call:
                  [code=php]
                  umask(0022);
                  [/code]

                  This will set the permissions mask to 0022, which means that any files or folders you create will start out with 0755 permissions.
                  That helped cause it gave me permission to delete it instead of having to get my friend (root user) to do it. But i still cant view it through ftp and http. There error page that comes up for the site is 403 forbidden and looks like this

                  Forbidden
                  You don't have permission to access /graphica/CoryThompson/index.php on this server.


                  --------------------------------------------------------------------------------

                  Apache/2.2.2 (Fedora) Server at flumesoft.com Port 80

                  I have deleted this now cause it's anoying on my server cause its not letting me use it. If you have any idea's please tell me

                  Thanks
                  Mague
                  ps. Read my other things for more information

                  Comment

                  • pbmods
                    Recognized Expert Expert
                    • Apr 2007
                    • 5821

                    #10
                    Heya, Mague.

                    Any chance you have an .htaccess file in there that is preventing access? A file with 0755 permissions should be readable by anybody.

                    Comment

                    • Mague
                      New Member
                      • May 2007
                      • 137

                      #11
                      hmm i deleted all htaccess files on the server and still nothing, thanks for helping thou

                      Thanks more then you think
                      Mague

                      Comment

                      Working...