Extensionless files to be parsed as php, HOW?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zalman
    Junior Member
    • Mar 2005
    • 9

    #1

    Extensionless files to be parsed as php, HOW?

    Hi all, I'm trying to get apache to parse all files without mine type (no extension) as PHP. It should be easy, I'm supposed to add this to .htaccess:

    DefaultType application/x-httpd-php

    But it doesn't work. I get error 500, internal server error, and the error is file has no execute mode. Apache is thinking it's a CGI file!

    All this is working on my home linux computer (i have apache 2.0 though).

    Any thoughts? Thx
  • sdjl
    Senior Member
    • Mar 2004
    • 502

    #2
    I don't think it's possible with PHPSuExec in operation.
    I had to change all my files to use mod_rewrite in the end.

    David
    -----
    Do you fear the obsolescence of the metanarrative apparatus of legitimation?

    Comment

    • bjacobs
      Junior Member
      • Mar 2004
      • 28

      #3
      The only thing I know how to do is to get a different extension to be parsed by php with the following:

      AddHandler application/x-httpd-php .php .shtml .html .htm

      That way I can parse php in htm, html, and shtml files. Probably doesn't help, but maybe it'll lead you in the right direction.

      Comment

      • Buddha
        Senior Member
        • Mar 2004
        • 825

        #4
        Just a thought have you tried something like:

        DefaultType application/x-httpd-fastphp
        "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

        Comment

        • Jonathan
          Senior Member
          • Mar 2004
          • 1229

          #5
          Originally posted by bjacobs
          The only thing I know how to do is to get a different extension to be parsed by php with the following:

          AddHandler application/x-httpd-php .php .shtml .html .htm

          That way I can parse php in htm, html, and shtml files. Probably doesn't help, but maybe it'll lead you in the right direction.
          In a PHPSuExec setup, that works; but you cannot set it to a "non standard" file type.
          "How can someone be so distracted yet so focused?"
          - C

          Comment

          • Zalman
            Junior Member
            • Mar 2005
            • 9

            #6
            Have you tried: DefaultType application/x-httpd-fastphp
            Just did, doesn't work, they just get application/x-httpd-fastphp mime type which opens a download box in firefox. In other words apache just pass them trough.

            Why did you think about this? Any links?

            Thanks guys for all responses!

            Comment

            Working...