Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541

    .htaccess AddHandler

    I'm having a issue with my .htaccess and getting php5 to load. Every time I insert and AddHandler all files on the site stop loading and are set to the browser as a file download

    Code:
    AddHandler application/x-httpd-php53 .php .php4 .php3 .phtml .tpl .html

  2. #2
    Join Date
    Jan 2011
    Location
    Canada
    Posts
    934
    VPS/dedi or shared host? If its the former, see thread

    http://www.webhostingtalk.com/showthread.php?t=1023010

    If its the later, you'll need to contact your host as they might not have set it up, or have done so slightly differently than most others.

  3. #3
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541
    Quote Originally Posted by tchen View Post
    VPS/dedi or shared host? If its the former, see thread

    http://www.webhostingtalk.com/showthread.php?t=1023010

    If its the later, you'll need to contact your host as they might not have set it up, or have done so slightly differently than most others.
    its dedicated... checking that link now.

  4. #4
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541
    I already have php4 and php5.3 compiled... i have a site that needs php4 and it works fine with AddHandler application/x-httpd-php4 set... but I have a subfolder with a script that needs php5. so I added a .htaccess file to that folder and tried using AddHandler application/x-httpd-php53 but it wont active php5. is it not possible to have multiple version of php running under one user account/webroot?

  5. #5
    Join Date
    Jan 2011
    Location
    Canada
    Posts
    934
    It should be possible as php requests are independent of each other. Could it be a permission thing? Also depending on how you have php accessed from apache, there are a couple more settings like Action, etc.

    http://www.askapache.com/htaccess/ph...nd-tricks.html

  6. #6
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541
    Quote Originally Posted by tchen View Post
    It should be possible as php requests are independent of each other. Could it be a permission thing? Also depending on how you have php accessed from apache, there are a couple more settings like Action, etc.

    http://www.askapache.com/htaccess/ph...nd-tricks.html
    folder that requires php5 is set to 755, and the addhandler is correct. i've googled it and copied directly from a few sites. still nothing. its like php4 is dominating the entire domain and not allowing php5 to run

  7. #7
    Join Date
    Jan 2011
    Location
    Canada
    Posts
    934
    I'm out of suggestions without knowing more. How is php integrated with your apache? CGI / suexec?

  8. #8
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541
    let me go over again what's happening.

    I made some changes but I'm still getting the same problem.

    1. Main site.com - is running php4
    2. sub.site.com - needs to run php5 i've added in the following Addhandler:
    AddHandler application/x-httpd-php5 .php .php4 .php3 .phtml .tpl .html
    AddHandler application/x-httpd-php .php .tpl .html .phtml

    no luck on any of those.
    3. i added a test.php with phpinfo() on the sub.site.com and its reading php4...
    4. went to the Main site.com and removed the Addhandler for php4 retested the test.php on sub.site.com and it read php5 (which is the system default) the script also loaded perfect fine.

    for some reason the htaccess under Main site.com is effecting the entire domain. why would something like this happen?

  9. #9
    Join Date
    Jan 2011
    Location
    Canada
    Posts
    934
    Um, check for wildcards in either ServerName or ServerAlias.

  10. #10
    Join Date
    Apr 2004
    Location
    Atlanta, GA
    Posts
    541
    Quote Originally Posted by tchen View Post
    Um, check for wildcards in either ServerName or ServerAlias.
    no wildcards in the httpd.conf for the main site.com and sub.site.com

Similar Threads

  1. how to prevent user from using AddHandler in .htaccess
    By ezak in forum Hosting Security and Technology
    Replies: 3
    Last Post: 09-26-2010, 11:30 AM
  2. Convert *htaccess* to *lighttpd htaccess* rules ??
    By xSinax in forum Hosting Security and Technology
    Replies: 2
    Last Post: 09-08-2010, 06:17 AM
  3. AddHandler in htaccess (Apache)
    By tlsuess in forum Programming Discussion
    Replies: 2
    Last Post: 02-06-2008, 04:34 PM
  4. .htaccess addHandler based on Environmental Variable
    By zosont in forum Programming Discussion
    Replies: 7
    Last Post: 08-21-2007, 10:46 AM
  5. catch all request with AddHandler
    By evilek in forum Programming Discussion
    Replies: 1
    Last Post: 06-16-2004, 05:31 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
  •