rename a file in Windows XP server using php script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nasse
    New Member
    • May 2007
    • 12

    rename a file in Windows XP server using php script

    I am trying to rename a file in Windows XP server using the following php script but i am getting "Permission denied".

    [code=php]
    <?php
    rename("file1.p hp", "file2.php" );
    ?>[/code]

    [Please use CODE tags when posting source code. Thanks! --pbmods]

    Pls help.
  • jx2
    New Member
    • Feb 2007
    • 228

    #2
    Originally posted by nasse
    I am trying to rename a file in Windows XP server using the following php script but i am getting "Permission denied".

    <?php
    rename("file1.p hp", "file2.php" );
    ?>

    Pls help.
    make sure file1.php its not "read only"

    Comment

    • nasse
      New Member
      • May 2007
      • 12

      #3
      Originally posted by jx2
      make sure file1.php its not "read only"
      It has full previllage set. I think it has to do with windows xp. I read at http://www.php.net/manual/en/function.rename .php and some one is saying the same.

      Comment

      • jx2
        New Member
        • Feb 2007
        • 228

        #4
        Originally posted by nasse
        It has full previllage set. I think it has to do with windows xp. I read at http://www.php.net/manual/en/function.rename .php and some one is saying the same.
        i run php on windows XP with apache i just try it and it works well - did you log in as an owner?

        Comment

        • nasse
          New Member
          • May 2007
          • 12

          #5
          Originally posted by jx2
          i run php on windows XP with apache i just try it and it works well - did you log in as an owner?
          Oh no, I am trying to run the script as a web user. I am also running windows IIS.

          Comment

          • jx2
            New Member
            • Feb 2007
            • 228

            #6
            Originally posted by nasse
            Oh no, I am trying to run the script as a web user. I am also running windows IIS.
            i didnt ment that lol :-)
            how did you start computer? is server running/started as an owner of computer with all privileges?

            :-)

            Comment

            • nasse
              New Member
              • May 2007
              • 12

              #7
              Originally posted by jx2
              i didnt ment that lol :-)
              how did you start computer? is server running/started as an owner of computer with all privileges?

              :-)
              Oh sorry about that. Yes as a root user.

              Comment

              • jx2
                New Member
                • Feb 2007
                • 228

                #8
                well :-) then i wish u luck :-)
                u can allways instal apache server :-)

                Comment

                • pbmods
                  Recognized Expert Expert
                  • Apr 2007
                  • 5821

                  #9
                  Does the folder in which you are operating also have write privileges for the web server User?

                  Comment

                  Working...