disable php engine on a folder and its sub folders ??

Discussion in 'PHP' started by orptiin, May 9, 2008.

  1. #1
    Hello
    I have a VPS, php5 runs as apache mod, for security I want disable php excute on a folder and its sub folders ??? how can I do ?

    thanks for your time !

    HN
     
    orptiin, May 9, 2008 IP
  2. lanmonkey

    lanmonkey Active Member

    Messages:
    549
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #2
    don think you can do that, but you prevent access to any .php file using simple deny rules in htaccess
     
    lanmonkey, May 9, 2008 IP
  3. wmtips

    wmtips Well-Known Member

    Messages:
    601
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #3
    wmtips, May 9, 2008 IP
  4. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #4
    Are you trying to disable php exec(), or are you trying to disable php from running on a directory?

    exec() can be disabled directly in httpd.conf, or in .htaccess. Php can be disabled using htaccess in the specific directory as wmtips suggested.
     
    jestep, May 9, 2008 IP
  5. orptiin

    orptiin Guest

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    some folders need to chmod 777 for users upload images, mp3 , 777 is not secure ??? so I want any php file can not run from these folders .

    I am newbie
    thanks
     
    orptiin, May 9, 2008 IP
  6. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #6
    Try chmod 666 or 776 for any of those folders. Test to make sure it works, but this should remove the ability to execute from all the files in that directory.
     
    jestep, May 12, 2008 IP