Permission problem in Domain

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vkas
    New Member
    • Feb 2009
    • 78

    Permission problem in Domain

    I have a website developed in php

    Web site is working ok and the products images are being uploaded in folder (pimgs) ok if it is hosted in any other domain (www.x.com / www.abc.com )!!!
    i have implemented

    the pictures are uploaded ok and the images are being saved in the (pimgs) folder!!

    Website also works perfectly locally also!!

    i have have checked the databases , path of image uploading and all other minor issue and found clear and error free!!!

    because if their would be any problem in Database or code it would not worked on the other domain where i hosted!!


    Problem is
    when i host the same site on the domain (www.gamehard.e u)
    it works ok but the images are not uploaded in the (pimgs folder)

    Some one guided me to give permission to (pimgs) folder

    now how to give them !!
    my pimgs folder have 4 more folder in it

    should i give permission to each and every foplder seperately or i have to give permission to just (pimgs)

    secondly what is the permission setting



    Please Help me to solve the issue
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    What kind of access do you have to the server box?

    Ideally, if you have root access to the server itself (via SSH, or something equivalent) you could issue a chown or chmod command to set the privileges of the folders you want.
    For example, on my Ubuntu test box, I would issue these commands to give PHP (or rather; Apache) write access to a specific dir:
    Code:
    $ sudo chown -R www-data /var/www/path/to/pimgs
    $ sudo chmod -R 0755 /var/www/path/to/pimgs
    This makes the user running Apache, www-data, the owner of the directory, and gives it write permission on it, while only allowing everybody else read permissions. (Note, the username may be different for your server)


    If you do not have root access to the box itself, a more complex method may be required.

    Commonly, shared hosts give you FTP access to the directory where you site is hosted. A good way to give PHP write access to those directories, without permanently leaving them with a to wide permission setting, is to temporarily set the permissions for the parent directory to 0777, using whichever FTP client you use - giving everybody the ability to write to it.
    Then create a PHP script that creates the target directory - using mkdir -, execute it and then reset the permissions on the parent.

    This should make the user executing the PHP script the owner of the target directory, giving it the ability to set the permissions as is needed.

    Comment

    • Vkas
      New Member
      • Feb 2009
      • 78

      #3
      Yes thanxxxiii

      i had done it very thanks

      Comment

      Working...