Apache/PHP add handler will not work for PHP5

2019-09-14 23:32发布

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.

1条回答
神经病院院长
2楼-- · 2019-09-14 23:34

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.

查看更多
登录 后发表回答