Conditional AddType ?

wanah

Well-Known Member
#1
Hello,

We're looking into howto make sure that sites don't break when we revert to apache.

We've set up multiple PHP versions but only with Litespeed and not with Apache.

Litespeeds documentation says to add :

AddType application/x-httpd-php54 php54

This is good for testing purposes but if this account was to be moved to a server without application/x-httpd-php54 the user would get errors.

Is there someway to make this conditional, like the ifModule or ifDefined directives in apache ?
 

wanah

Well-Known Member
#3
Thanks, that will solve my immediate problem,

Some suppliers allow users to add something like this to their .htaccess :

SetEnv PHP_VER_5_5

This makes sure the htaccess stays compatible with other hosts.

Any idea if something like this would be compatible with litespeed ? Like checking if PHP_VER_5_5 is set and adding the addtype automaticaly ?
 

wanah

Well-Known Member
#5
I think they did use suphp at that time this file allowed the user to set things like :

SetEnv REGISTER_GLOBALS 0
SetEnv ZEND_OPTIMIZER 1
SetEnv MAGIC_QUOTES 1
SetEnv PHP_VER 5
SetEnv IONCUBE 1
SetEnv ZEND_OPTIMIZER 0
SetEnv PHP_VER 5

The company in question is here :

http://help.ovh.co.uk/ConfigPhp

They have now switched to a new system that uses PHP-FPM and they've now got ovh.config files as specified here :

http://www.ovh.com/fr/g1207.configurer-php-web

the customers add the following to a ovh.config file they create.

app.engine=php
app.engine.version=5.4
http.firewall=none
environment=production

I would love to know how they do this it seems much cleaner than using .htacess files for choosing their PHP version
 
Top