Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Senior Member hagen's Avatar
    Join Date
    Aug 2005
    Posts
    408
    Member #
    10882
    Liked
    1 times
    Hi,

    I am writing a php script to change the .htpasswd...

    All is fine, but I am unable to write the new file I have prepared at the end, owing to file premissions...

    How is this done?

    Cheers -Hagen
    Hagen Rose: hagen(at)jxwd(dot)co(dot)uk
    JX Web Development, Bournemouth, Dorset...JXWD.co.uk

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Well, you might have to change the file permissions :-) You can usually do this via FTP. The trouble is, if, say, Apache is running as the user `apache' and group `apache' and the .htpasswd file has a user and group different from that, you'll probably have to make the file world-writable, which is a security hole the size of a small continent.

  4. #3
    Senior Member hagen's Avatar
    Join Date
    Aug 2005
    Posts
    408
    Member #
    10882
    Liked
    1 times
    cheers shadowfiend,

    not sure i understand this is bit new to me...

    apache sets the permissions back as soon as any access is made, and i gues rightly so.....

    surely this is a fairly normal thing to want to do... how do you chage a user password?

    cheers -hagen
    Hagen Rose: hagen(at)jxwd(dot)co(dot)uk
    JX Web Development, Bournemouth, Dorset...JXWD.co.uk

  5. #4
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Ah, interesting. What are the permissions and user/group on the file right now?

  6. #5
    Senior Member hagen's Avatar
    Join Date
    Aug 2005
    Posts
    408
    Member #
    10882
    Liked
    1 times
    They are currently at: 644

    -H
    Hagen Rose: hagen(at)jxwd(dot)co(dot)uk
    JX Web Development, Bournemouth, Dorset...JXWD.co.uk

  7. #6
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Try creating a file with PHP and see what permissions and user/group it gets. There's a possibility it's set to create them with wrong permissions, which, if I remember correctly, is fixable.

  8. #7
    Senior Member hagen's Avatar
    Join Date
    Aug 2005
    Posts
    408
    Member #
    10882
    Liked
    1 times
    Thanks, that was pretty well it...

    I was creating it with a owner me, and then trying to change it with the script...

    When I created it with the script the user was "none" so it was able to change it using owner, rather that group or public....

    So its all fixed now... :-)
    Hagen Rose: hagen(at)jxwd(dot)co(dot)uk
    JX Web Development, Bournemouth, Dorset...JXWD.co.uk

  9. #8
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Awesome :-)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:46 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com