+ Reply to Thread
Results 1 to 4 of 4

Thread: Permissions Question

  1. #1
    dsx724 is offline W00TMIN
    Join Date
    Dec 2007
    Location
    East Coast
    Posts
    13
    WHB Points this Month
    0.00
    WHB Points
    0.00
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Permissions Question

    Apache and my main FTP account are running under different user id's (65534 and 1022 respectively). Whenever I tried to overwrite files created with PHP through FTP or edit those files through CPanel File Manager, I get a permission denied error.

    Along the same lines, if I create a folder with FTP (perm 755), I'm unable to run PHP scripts that create files. I get a permission denied error. Anybody know any tricks to get around this besides chmod 777 everything?

  2. #2
    MyWebs is offline Moderator
    Join Date
    Jun 2008
    Location
    Las Vegas, NV.
    Posts
    57
    WHB Points this Month
    0.00
    WHB Points
    5.00
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    From what little I understand the first case you describe is quite natural and the files created via PHP get owner'd to the user nobody which is the user Apache runs as. The second case you describe just shouldn't be happening IMO.

    From reading a few threads relating to this issue I found in Google it would seem you have 2 choices for the first problem you describe.

    1) Open a support ticket and get an admin to 'chown' your files / folders for you.

    2) You can do what you didn't want to do and chmod your files to 777 so you have access to delete the file. Then you can reupload the file so you are now the owner.

    I have found this script to be usefull when I have had the problem you describe in the first case: Cleanup PHP script This script is an addon to Gallery, I didn't write this code. It will chmode the folder you select and all files within to 777 so you can regain access to your files / folders. Change the file extension from .txt to a .php, use it then get rid of it from your web space for security reasons!! I have no clue if this would help in the second problem as I have never had that happen to me.

    The second problem you describe just shouldn't happen from what I understand under normal circumstances but I very well could be wrong being the noob I am. I suspect you have some sort of bad config or other screwed up setting in your sites settings that WHB would need to help you with.
    Thanks,
    Tony
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Get published on a top 100 web site where they share revenue.
    Take The Tour to learn more. (I am compensated for referral)
    Then sign up for free to Make Money Writing. (Always Free)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  3. #3
    Alan B's Avatar
    Alan B is offline Super Moderator
    Join Date
    Jul 2007
    Location
    Toronto, Canada
    Posts
    1,386
    WHB Points this Month
    0.00
    WHB Points
    290.00
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default

    What server are you on? Many (maybe even most?) WHB server use SuPHP, so that PHP scripts run as the account owner. That makes it possible to edit files created by PHP scripts.

    Perhaps WHB staff can comment on which servers do not run SuPHP.

  4. #4
    omniuni's Avatar
    omniuni is offline Jewbergeek!
    Join Date
    Jul 2007
    Posts
    181
    WHB Points this Month
    0.00
    WHB Points
    0.00
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I think MyWebs' suggestion will probably work. In whatever FTP client you use, right-click the folder, and look for "Permissions" "Ownership" "Chmod" or something along those lines. Make sure it is Readable, Writable, and Executable. Let the client apply this to all sub-folders and documents.

    Good Luck!

    Note: On windows, I recommend Filezilla, and on Linux, I just use Konqueror the file manager which does an excellent job with integrated FTP. Make sure you're NOT using Windows Explorer for FTP which will likely exacerbate issues!

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts