The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Enabling suPHP serves files as download

Discussion in 'EasyApache' started by Visualq, Mar 23, 2014.

  1. Visualq

    Visualq Member

    Joined:
    May 12, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    I just setup a new VPS with cpanel and the first thing I did was updating apache to 2.4.7 and php to 5.5.10. After the update I enabled suexec on PHP. I noticed that the php files were served as downloads. Further investigating the problem and reading a lot of threads about the problem I concluded that none of the provided solutions worked for me.

    What did work, but which I don't want to do every time I update PHP is manually editing /usr/local/apache/conf/php.conf after running /usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1. And change the line that says:

    suPHP_AddHandler application/x-httpd-php5

    to:

    suPHP_AddHandler application/x-httpd-php

    restart apache and php files are no longer served as a download.

    But like I said I don't want to do this after every php version update. Is there a way to fix this? It seems like a bug to me.

    Thanks in advance
     
  2. Visualq

    Visualq Member

    Joined:
    May 12, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Ok, problem solved, it was my own fault.

    I had:

    AddType application/x-httpd-php .php

    in the .htaccess which was the cause of the problem.
     
  3. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    569
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Glad that you solved the issue. Thank you for updating this thread with your solution.
     
Loading...

Share This Page