PHP file downloads instead of executing

Discussion in 'Apache' started by Nick_Mayhem, Dec 2, 2008.

  1. #1
    Hello,

    I recently had a problem with one server.

    PHP died and it was recompiled. But in the meantime when I was trying to visit my site it was giving index.php for download :(

    Is there someway that can prevent it from giving away php files for download in this type of scenario?

    Thanks.
     
    Nick_Mayhem, Dec 2, 2008 IP
  2. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #2
    Try to select default version from "php configuration" from your cPanel (X3 theme needed) if you have dual PHP versions compiled.

    If it doesn't work try to add following line in your .htaccess file:
    AddHandler application/x-httpd-php .php

    Place this .htaccess file outside the public_html folder.

    Kailash
     
    kailash, Dec 5, 2008 IP