Apache/PHP add handler will not work for PHP5

巧了我就是萌 提交于 2020-01-16 08:07:13

问题


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:


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.



来源:https://stackoverflow.com/questions/10872759/apache-php-add-handler-will-not-work-for-php5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!