Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 384
Lee Kowalkowski Avatar asked Mar 01 '23 13:03

Lee Kowalkowski


1 Answers

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>.

like image 144
mercator Avatar answered May 01 '23 18:05

mercator