Results 1 to 21 of 21
  1. #1

    apache making vistors download my php files HELP!

    Hello im in nedd of serious help here, i had done a apche rebuild last nite so i could add ioncube etc and suphp but now when i visit a site on my server that runs php i am able to download the php file ( with the proper source)


    Is there a way to fix this quick?

    Please help

  2. #2
    Join Date
    Oct 2007
    Location
    CA,USA
    Posts
    320
    DO you use cPanel/WHM or did you compile it yourself?

  3. #3
    yes it is cpanel/whm & yes i did do it myself..

    Do you know how to fix?

  4. #4
    Join Date
    Jan 2001
    Location
    Missouri
    Posts
    298
    DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl

    and check AddType application
    Last edited by Newbie; 08-31-2009 at 07:10 AM. Reason: duhh
    eeeeeeeeeeeeeeeewwwww it's broke

  5. #5
    Quote Originally Posted by Newbie View Post
    DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl
    Explain please.

  6. #6
    Join Date
    Oct 2007
    Location
    CA,USA
    Posts
    320
    Did you compile Apache with PHP support? Somehow it could have got unchecked or didn't compile correctly.

    When you were compiling it were there no build errors?

  7. #7
    Quote Originally Posted by HDNP-EricI View Post
    Did you compile Apache with PHP support? Somehow it could have got unchecked or didn't compile correctly.

    When you were compiling it were there no build errors?
    I believe i did, i am now doing a basic rebuild to see what happens now
    Hopefully it fixes the issue

    and no there was not no build errors

  8. #8
    Join Date
    Jan 2001
    Location
    Missouri
    Posts
    298
    Quote Originally Posted by Reece|StormingHost View Post
    Explain please.
    your httpd.conf file

    should have those in there and something like this

    AddType application/x-httpd-php .php
    eeeeeeeeeeeeeeeewwwww it's broke

  9. #9
    There is nothing like that in the file...

    How would i make apache back to its default install?

  10. #10
    Join Date
    Jan 2001
    Location
    Missouri
    Posts
    298
    Read the apache doc files on the version of apache you have

    http://httpd.apache.org/docs/

    your problem is in the config of apache. httpd.conf it's an easy fix. I have to go to work.

    Also for others to help provide the Server: Linux or Windows and the version of apache your using.
    eeeeeeeeeeeeeeeewwwww it's broke

  11. #11
    Join Date
    Apr 2007
    Location
    US, UK, Europe, ME
    Posts
    258
    Hello,

    Please add the following lines to your httpd.conf file :

    AddType application/x-httpd-php .php .phtml .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .php4 .php5
    AddHandler application/x-httpd-php .html .htm

    Then, restart your apache and try again.

    Regards,

  12. #12
    I have 2.0 & also tried to rebuild as 1 and 2.2 still not luck im using linux ( centos)

    Im not sure how i can edit my config...

  13. #13
    Join Date
    Nov 2001
    Location
    The South
    Posts
    5,403
    Wait you're recompiling apache and php and running a server and don't know the basics? You need some server management in a bad way. No offense but I hope you don't have customers on this server? Your name indicates you are a webhost yourself, but you don't know about how to even edit the httpd.conf? I'm not trying to be rude but wow you need to hit the offers section down at the bottom of the forums and find yourself an admin asap!
    Gary Harris - the artist formerly known as Dixiesys
    resident grumpy redneck

  14. #14
    Quote Originally Posted by Sys Admin View Post
    Hello,

    Please add the following lines to your httpd.conf file :

    AddType application/x-httpd-php .php .phtml .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .php4 .php5
    AddHandler application/x-httpd-php .html .htm

    Then, restart your apache and try again.

    Regards,
    I have added this and nothing has happen, but is there a certain place is hould add it?

  15. #15
    Join Date
    Oct 2007
    Location
    CA,USA
    Posts
    320
    Do note he's using cPanel/WHM

  16. #16
    Join Date
    Nov 2001
    Location
    The South
    Posts
    5,403
    Quote Originally Posted by HDNP-EricI View Post
    Do note he's using cPanel/WHM
    True but surely SOMEONE is "root" on this server you'd assume. And on the same token, you'd hope that someone would be able to edit the httpd.conf file and check this
    Gary Harris - the artist formerly known as Dixiesys
    resident grumpy redneck

  17. #17
    My tech is currently on holiday he has been with us from the start i know alot but ssh isnt really my thing to be honest

  18. #18
    Join Date
    Jan 2001
    Location
    Missouri
    Posts
    298
    Bad time to decide to rebuild apache then..

    I'm not familiar with cpanel and apache configurations with it's easywhatevertheycall it. So you'll need to read this http://www.cpanel.net/documentation/easyapache/ea3.html


    httpd config locations


    * Individual VirtualHost
    /usr/local/apache/conf/userdata/(ssl|std)/(1|2)
    /<user>/<domain>/<something>.conf
    * All VirtualHost containers
    /usr/local/apache/conf/userdata/<something>.conf
    * All VirtualHost containers for SSL or standard VirtualHosts
    /usr/local/apache/conf/userdata/[ssl or std]/<something>.conf
    * All VirtualHost containers for SSL or standard VirtualHosts with version specific settings
    /usr/local/apache/conf/userdata/[ssl or std]/[1 or 2]/<something>.conf
    * All of a users VirtualHost containers for SSL or standard VirtualHosts with version specific settings
    /usr/local/apache/conf/userdata/[ssl or std]/[1 or 2]/ /<something>.conf
    * Individual VirtualHost container for SSL or standard VirtualHosts with version specific settings
    /usr/local/apache/conf/userdata/[ssl or std]/[1 or 2]/<user>/<domain>/<something> .conf

    to edit files (use nano if you have no idea about vi. it's not new user friendly) I assume cpanel has some interface built into it now since I've been out of the business since 2000. Read the docs from the link I posted above. If you want to do it by hand then.

    SSH way
    # vi /location/filename

    or

    # nano /location/filename
    eeeeeeeeeeeeeeeewwwww it's broke

  19. #19
    Join Date
    Jul 2009
    Location
    Manila
    Posts
    301
    Quote Originally Posted by Reece|StormingHost View Post
    My tech is currently on holiday he has been with us from the start i know alot but ssh isnt really my thing to be honest
    Maybe you know a lot about other things but clearly you do not know the basics of server management. You are in serious trouble here. No offense but I think it's time to page your admin and get at least 2 hours of his time. Try rebuilding your apache again and make sure the basics are checked.

  20. #20
    Join Date
    Jun 2006
    Posts
    1,111
    I assume you have immediately STOPPED apache, then considering you're using WHM/cPanel just use the GUI to rebuild into a safe setup... once working leave things until your server admin returns and don't be so silly in future! I seriously hope there are no customers on this machine, leaking PHP source code would be a real pain in the ass for some customers. It gets worse.. database passwords and so on are stored in those files. Now that I think about it, I hope any customers you may have had now run away.

  21. #21
    Join Date
    May 2009
    Location
    SLASH ROOT
    Posts
    853
    You are obviously missing a PHP handler.

    Since this is a cPanel server login to WHM > Service Configuration -> Configure PHP and suEXECPHP (now moved to Apache configuration) > Then choose the handler (in your case suPHP) for the PHP version you are running.

    Restart the webserver, clear your browsers cache and try again.

Similar Threads

  1. why won't my files download...
    By ThatScriptGuy in forum Hosting Security and Technology
    Replies: 1
    Last Post: 03-05-2007, 07:52 PM
  2. Making test files for download
    By Eiolon in forum Web Hosting
    Replies: 4
    Last Post: 03-02-2004, 09:15 PM
  3. some sort of apache error, prompting to download .php files.
    By Flammable in forum Hosting Security and Technology
    Replies: 2
    Last Post: 02-12-2004, 06:09 PM
  4. download files
    By greatdealhos in forum Programming Discussion
    Replies: 3
    Last Post: 12-12-2003, 11:10 AM
  5. making cron files to backup important files?
    By JDTurbeville in forum Hosting Security and Technology
    Replies: 1
    Last Post: 01-20-2003, 04:59 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
  •