0

My clients host uses PHP4 and 5 and all *.php files run via 5 but when I use this

<FilesMatch "edit.js"> AddHandler application/x-httpd-php .js </FilesMatch>

it runs as PHP 4.4.9 but not on my personal web server (VPS) I need this file.

<FilesMatch "edit.js"> AddHandler application/x-httpd-php5 .js </FilesMatch>

doesn't seem to work just displays source code of PHP.

and help appreciated.

hakre
  • 193,403
  • 52
  • 435
  • 836
Bradley Weston
  • 425
  • 1
  • 7
  • 17
  • 1
    With what specifically you need help (a.k.a. what is your question)? – hakre Jun 03 '12 at 18:27
  • Why are you trying to add a handler for this file? Usually one would have a php file and use mod_rewrite to redirect `edit.js` there. – mensi Jun 03 '12 at 18:53

1 Answers1

1

Try

AddHandler application/x-httpd-php5 .js
                                  ^---

Since, as you say, your host has both PHP 4 and PHP 5, you need to expclitly say which version you want used.

Marc B
  • 356,200
  • 43
  • 426
  • 500
  • Well, which apache handler is configured for `application/x-httpd-php5`? You need to mimic the webservers configuration on your localhost to get the same behaviour. – hakre Jun 03 '12 at 18:48