如何支持"将AddType的X MAPP-PHP5的.php"在我的开发机 [英] How to support "AddType x-mapp-php5 .php" on my development machine

查看:200
本文介绍了如何支持"将AddType的X MAPP-PHP5的.php"在我的开发机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的ISP要求我把我的.htaccess文件如下:

My ISP requires me to put the following in my .htaccess files:

AddType x-mapp-php5 .php

不过,打破自己的计算机。

But that breaks my development machine.

我真的不明白,指令是什么,但我生病了注释出来进行开发,并取消注释它,每当我需要上传一个新的版本。

I don't really understand what that directive is for, but I'm sick of commenting it out for dev, and uncommenting it whenever I need to upload a new version.

有没有在开发支持它的一些方式?

Is there some way of supporting it in dev?

推荐答案

您可以尝试在 < IfModule> 的Apache从生产机器区分开发计算机

You could try the <IfModule> Apache directive to distinguish your development machine from the production machine.

例如。以下将工作,如果你正在运行PHP作为一个Apache模块,并且您的ISP运行它作为CGI:

E.g. the following would work if you're running PHP as an Apache module, and your ISP runs it as CGI:

<IfModule !mod_php5.c>
AddType x-mapp-php5 .php
</IfModule>

您也可以检查一个PHP4模块的存在。

You could also check for the existence of a PHP4 module.

或者你可以通过一个启动参数到Apache开发机器上,并检查,使用<一个href="http://httpd.apache.org/docs/2.0/mod/core.html#ifdefine"><$c$c><IfDefine>.

Or you could pass a startup parameter to Apache on your development machine and check for that using <IfDefine>.

这篇关于如何支持&QUOT;将AddType的X MAPP-PHP5的.php&QUOT;在我的开发机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆