File upload problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • federicog
    New Member
    • Mar 2007
    • 30

    File upload problem

    I developed a simple file manager a while ago in it worked perfectly until we switched hosting.

    Now I can't upload files to any folder created through the file manager. If I create a folder in FTP, I can then upload anything to it using the file manager.

    I suppose the problem is that when I create a directory from php it has different user & group than when I create it using FTP, since both folders get the right permissions (777).

    Any ideas on how to solve this problem? safe_mode is enabled... could that be the problem?

    Thanks
    Fede
  • devsusen
    New Member
    • Feb 2007
    • 136

    #2
    Hi,

    php script is executed by apache. So using it if u create a directory then apache becomes the user of the directory. As a result u can't upload a file in that dir. To solve this u need to give the permission (777) and change the user of the dir using the same or different php script.

    susen

    Comment

    • federicog
      New Member
      • Mar 2007
      • 30

      #3
      Originally posted by devsusen
      Hi,

      php script is executed by apache. So using it if u create a directory then apache becomes the user of the directory. As a result u can't upload a file in that dir. To solve this u need to give the permission (777) and change the user of the dir using the same or different php script.

      susen
      I don't understand. If apache creates a directory, why can't it also upload files to it? I tried changing owner with chown and chgrp but it didn't work, and the directory already has chmod 777 :(

      Thanks for your help!

      Comment

      • devsusen
        New Member
        • Feb 2007
        • 136

        #4
        Hi,

        I hope u r getting some error. If not try to get the error then it will easier to understand the problem. Still it seems to me some permission problem happening.

        susen

        Comment

        • code green
          Recognized Expert Top Contributor
          • Mar 2007
          • 1726

          #5
          The XAMMP package contains php, Apache and an FTP application Filezilla. They all seem compatible and I have Filezilla running to download files from a remote to a local server. I can't remember how I configured it, but Filezilla and Apache are compatible

          Comment

          • federicog
            New Member
            • Mar 2007
            • 30

            #6
            I finally got error_reporting working (damn display_errors was set to Off by default) and this is what I get:

            Warning: move_uploaded_f ile(): SAFE MODE Restriction in effect. The script whose uid is 10022 is not allowed to access /var/www/vhosts/x.com/httpdocs/admin/archivos/test owned by uid 48 in /var/www/vhosts/x.com/httpdocs/admin/sections/files_publish.p hp on line 26

            I'll try disabling safe_mode, but I think it's not something I can set.

            Thanks
            Fede

            Comment

            • federicog
              New Member
              • Mar 2007
              • 30

              #7
              It worked by disabling safe_mode :D

              Comment

              • devsusen
                New Member
                • Feb 2007
                • 136

                #8
                thats gr8. :)

                Originally posted by federicog
                It worked by disabling safe_mode :D

                Comment

                Working...