How to support “AddType x-mapp-php5 .php” on my development machine

前端 未结 2 1923
余生分开走
余生分开走 2021-01-14 02:07

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

AddType x-mapp-php5 .php

But that breaks my development machine.

I d

相关标签:
2条回答
  • 2021-01-14 02:17

    This merely tells the web server that files with the extension .php are to be handled by the PHP module.

    But I would recommend asking web-server related questions on serverfault.com, where your question won't get closed (with the reason belongs on serverfault.com) and where you will receive much better answers than here.

    0 讨论(0)
  • 2021-01-14 02:40

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

    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>
    

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

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

    0 讨论(0)
提交回复
热议问题