Conditional AddType ?

Discussion in 'Install/Configuration' started by wanah, Oct 16, 2013.

  1. wanah

    wanah Member

    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 ?
  2. mistwang

    mistwang LiteSpeed Staff

    Yes, just use something like <IfModule litespeed> , it will be ignored by Apache.
  3. wanah

    wanah Member

    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 ?
  4. mistwang

    mistwang LiteSpeed Staff

    no plan on that yet. not aware which setup uses that. Is that for suphp setup? PHP selector?
  5. wanah

    wanah Member

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

    wanah Member

    Well it seems this is no longer needed as 4.5 ! Thank's ! Will try an update in a few weeks.

Share This Page