1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Apache Prompting to Download File php file in the userdir

Discussion in 'Apache' started by nicksaliba, Mar 18, 2010.

  1. #1
    I just updated My Debian yesterday without changing the configuration of the Apache server.

    When i open any php file on localhost in the user directory it s prompting me a Save/Download Fire or open with program file .
    Anyone can help me with a solution .

    NB: phpmyAdmin is working perfectly .
    Anyone encountered this problem ? Need some help !!!

    Thank you in advance

     
    Last edited: Mar 18, 2010
    nicksaliba, Mar 18, 2010 IP
  2. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #2
    Sounds like Apache does not have the handler setup for .php files, or, you have it turned off for that directory. Are there any .htaccess files within the folder that may be turning it off?
     
    RHS-Chris, Mar 18, 2010 IP
  3. nicksaliba

    nicksaliba Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i searched for .htaccess this is my result of my search.

    /usr/share/doc/python-feedparser/docs/examples/.htaccess
    /usr/share/phpmyadmin/libraries/.htaccess
    /usr/share/phpmyadmin/setup/lib/.htaccess
     
    nicksaliba, Mar 18, 2010 IP
  4. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #4
    Have you tried restarting the web server?
     
    RHS-Chris, Mar 18, 2010 IP
  5. nicksaliba

    nicksaliba Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Sure i tried Didn't work :(
     
    nicksaliba, Mar 18, 2010 IP
  6. najiag

    najiag Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hi all,
    I have the same problem here. php was working pefrectly before I update. I am on Debian squeeze. When I try to open any php file in the userdir a pop up asking me where I want to save the php file appears.
    phpmyadmin is working.
    I would really appreciate some help here.
    Thanks in advance.
     
    najiag, Mar 18, 2010 IP
  7. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #7
    Perhaps try re-installing PHP, something may have broke during the update.
     
    RHS-Chris, Mar 18, 2010 IP
  8. nicksaliba

    nicksaliba Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    didn't work for me same problem
     
    nicksaliba, Mar 18, 2010 IP
  9. najiag

    najiag Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I reinstalled php and apache2 and phpmyadmin since it removed it by itself. still same problem. in the userdir php is not working but phpmyadmin is working.
     
    najiag, Mar 18, 2010 IP
  10. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #10
    I would peruse through your Apache configuration files and see if somewhere php is being disabled.
     
    RHS-Chris, Mar 18, 2010 IP
  11. nicksaliba

    nicksaliba Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    umm sure what Files you want me to show you ?
     
    nicksaliba, Mar 18, 2010 IP
  12. najiag

    najiag Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I search in all the apache config filesif there is anything related to userdir that is strange but no everything is just like on the online server where everything is working fine.
    Where in the configuration files Chris do you suspect a problem?
    below is the output of my command.
    naji@naji:/etc/apache2$ grep -ri userdir ./
    ./mods-enabled/userdir.load:LoadModule userdir_module /usr/lib/apache2/modules/mod_userdir.so
    ./mods-enabled/userdir.conf:<IfModule mod_userdir.c>
    ./mods-enabled/userdir.conf: UserDir public_html
    ./mods-enabled/userdir.conf: UserDir disabled root
    ./mods-enabled/php5.conf: <IfModule mod_userdir.c>
    ./mods-available/userdir.load:LoadModule userdir_module /usr/lib/apache2/modules/mod_userdir.so
    ./mods-available/userdir.conf:<IfModule mod_userdir.c>
    ./mods-available/userdir.conf: UserDir public_html
    ./mods-available/userdir.conf: UserDir disabled root
    ./mods-available/php5.conf: <IfModule mod_userdir.c>
     
    najiag, Mar 18, 2010 IP
  13. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #13
    What is the content of this file

    mods-enabled/php5.conf
     
    RHS-Chris, Mar 18, 2010 IP
  14. nicksaliba

    nicksaliba Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    <IfModule mod_php5.c>
    <FilesMatch "\.ph(p3?|tml)$">
    SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
    </FilesMatch>
    <IfModule mod_userdir.c>
    <Directory /home/*/public_html>
    php_admin_value engine Off
    </Directory>
    </IfModule>
    </IfModule>
     
    nicksaliba, Mar 18, 2010 IP
  15. najiag

    najiag Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    <IfModule mod_userdir.c>
    <Directory /home/*/public_html>
    php_admin_value engine Off
    </Directory>
    </IfModule>
    nicksaliba You need to comment these lines. Do not set engine to On.
    Thanks a lot Chris for your help.
     
    najiag, Mar 18, 2010 IP
  16. nicksaliba

    nicksaliba Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Thank you Najiag and thank you Chris for your help much appreciated .
     
    nicksaliba, Mar 18, 2010 IP
  17. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #17
    That's what I was hoping to see, glad its all sorted out now:)
     
    RHS-Chris, Mar 18, 2010 IP