+ Reply to Thread
Results 1 to 9 of 9

Thread: http access and php read/write permissions.... one question !!

  1. #1
    careerbridge's Avatar
    careerbridge is offline x10 Sophmore careerbridge is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    India
    Posts
    126

    Question http access and php read/write permissions.... one question !!

    Hi,

    I need to have a file which is not at all available with http, but should be able to read/write using php.
    • Where i have to place this file???
    • What should be its permission??
    • What will be its php access path
    The php file will be located at the public_html folder...

    Sicerely,
    Jim Jose

  2. #2
    bigguy's Avatar
    bigguy is offline Retired bigguy is an unknown quantity at this point
    Join Date
    Mar 2005
    Location
    Canada
    Posts
    5,426

    Re: http access and php read/write permissions.... one question !!

    Can you give us a bit more information please.
    P.C. Tweakr - For all your computer and internet support
    P.C. Tweakr - For all your SMF help and support

  3. #3
    careerbridge's Avatar
    careerbridge is offline x10 Sophmore careerbridge is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    India
    Posts
    126

    Re: http access and php read/write permissions.... one question !!

    Ok,

    I have a php file index.php which is located in the public_html folder. From this file I have to read/write an another file online.txt using the fopen function.

    But I don't want my clents to access this file (online.txt) via http://www.mysite.com/online.txt (normally the browser will prompt to download the file when enter this path)

    I think its clear now...

  4. #4
    bigguy's Avatar
    bigguy is offline Retired bigguy is an unknown quantity at this point
    Join Date
    Mar 2005
    Location
    Canada
    Posts
    5,426

    Re: http access and php read/write permissions.... one question !!

    Could you use htaccess to stop ppl from getting to "online.txt"
    P.C. Tweakr - For all your computer and internet support
    P.C. Tweakr - For all your SMF help and support

  5. #5
    PSP-Heaven is offline x10 Sophmore PSP-Heaven is an unknown quantity at this point
    Join Date
    May 2006
    Posts
    214

    Re: http access and php read/write permissions.... one question !!

    Or you can jus chmod it so that it is writable by admin, make sure writable by admin is checked, and all the others are not checked. thats should work, if not, chmod it to 000, that should also work.
    Domainlagoon.com
    Win a free domain, you only need to complete a few offers. I am amazed to, you can get .com, .org, .biz, .net, and others for 9.95 points. While for 4 points you can get a .info domain. It's even better than ezyrewards.



    Before I had to switch to dial up, man I miss these speeds.


  6. #6
    The_Magistrate's Avatar
    The_Magistrate is offline x10 Elder The_Magistrate is an unknown quantity at this point
    Join Date
    May 2005
    Location
    PA
    Posts
    559

    Re: http access and php read/write permissions.... one question !!

    Quote Originally Posted by PSP-Heaven
    Or you can jus chmod it so that it is writable by admin, make sure writable by admin is checked, and all the others are not checked. thats should work, if not, chmod it to 000, that should also work.
    DO NOT CHMOD 000! If you do that, you will not be able to read the file. Also, PHP is not run with root privileges and will not be able to read the file either. Performing a chmod 000 will only create more problems.

    Geoff is right. You should use your .htaccess file to restrict people from accessing online.txt from a web browser. If you properly restrict the file with .htaccess, you can safely chmod 755 the file.

    @PSP-Heaven if you know anyone who has a server with PHP running with root privileges please tell them to correct that problem and to talk to someone who knows what they are doing. It boggles my mind as to how much of a vulnerability that is.
    Last edited by The_Magistrate; 06-14-2006 at 08:09 PM.
    Getting Started | Terms of Service | Paid Hosting | Forum Rules | Free Server Status | Banned Countries

    If I have helped you through one of my posts, please click the
    blue checkbox on the right below my avatar to add to my reputation.

  7. #7
    careerbridge's Avatar
    careerbridge is offline x10 Sophmore careerbridge is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    India
    Posts
    126

    Re: http access and php read/write permissions.... one question !!

    Yeah, that right... I already tried the chmod method and it will not work....

    I need to warn PSP-Heaven, bcose once u set chmod 0, u will lose the file permanently. Only one command will work.... delete

    Btw, I found good article abt using .htaccess and I think it may be usefull to someone else here...
    http://www.javascriptkit.com/howto/htaccess.shtml

    Thank u guys for the reply.

  8. #8
    Mike-lane is offline Complete IDIOT Mike-lane is an unknown quantity at this point
    Join Date
    Jun 2006
    Posts
    37

    Re: http access and php read/write permissions.... one question !!

    umm htaccess it. I think with linux _ infront of a folder name makes it locked :lockd: so put it in a folder with _ at the beginning?
    Last edited by Mike-lane; 06-17-2006 at 06:05 PM.

  9. #9
    careerbridge's Avatar
    careerbridge is offline x10 Sophmore careerbridge is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    India
    Posts
    126

+ Reply to Thread

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 43
    Last Post: 03-24-2011, 07:27 AM
  2. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 09:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers