Rectangle 27 0

XAMPP conf Run php5_module per default & switch to other php cgi versions per .htaccess?


#
# XAMPP settings
#

<IfModule env_module>
    SetEnv MIBDIRS "/xampplite/php/extras/mibs"
    SetEnv MYSQL_HOME "\\xampplite\\mysql\\bin"
    SetEnv OPENSSL_CONF "/xampplite/apache/bin/openssl.cnf"
    SetEnv PHP_PEAR_SYSCONF_DIR "\\xampplite\\php"
    SetEnv PHPRC "\\xampplite\\php"
    SetEnv TMP "\\xampplite\\tmp"
    UnsetEnv PERL5LIB
</IfModule>

#
# PHP-Module setup (module as default version 5.3 in my case)
#

LoadFile "/xampplite/php/php5ts.dll"
LoadModule php5_module modules/php5apache2_2.dll

<IfModule php5_module>
    <FilesMatch "\.php$">
        AddHandler application/x-httpd-php .php
        #SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </FilesMatch>
    PHPINIDir "/xampplite/php"
</IfModule>


#
# PHP-CGI multiple Version Setup
#

Action application/x-httpd-php4_3 "/php4_3/php.exe"
AddType application/x-httpd-php4_3 .php4 .php

Action application/x-httpd-php4_4 "/php4_4/php.exe"
AddType application/x-httpd-php4_4 .php4 .php

Action application/x-httpd-php5_4 "/php5_4/php-cgi.exe"
AddType application/x-httpd-php5_4 .php5 .php  

Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
AddType application/x-httpd-php-cgi .php  

<IfModule mime_module>
    AddType text/html .php .phps
</IfModule>

ScriptAlias /php4_3/ "/xampplite/php4_3/"
<Directory "/xampplite/php4_3">
  AllowOverride None
  Options None
  Order allow,deny
  Allow from all
</Directory>

ScriptAlias /php4_4/ "/xampplite/php4_4/"
<Directory "/xampplite/php4_4">
  AllowOverride None
  Options None
  Order allow,deny
  Allow from all
  SetEnv PHPRC "\\xampplite\\php4_4"
</Directory>

ScriptAlias /php5_4/ "/xampplite/php5_4/"
<Directory "/xampplite/php5_4">
  AllowOverride None
  Options None
  Order allow,deny
  Allow from all
  SetEnv PHP_PEAR_SYSCONF_DIR "\\xampplite\\php5_4"
  SetEnv PHPRC "\\xampplite\\php5_4"
</Directory>

ScriptAlias /php-cgi/ "/xampplite/php/"
<Directory "/xampplite/php">
    AllowOverride None
    Options None
    Order deny,allow
    Deny from all
    <Files "php-cgi.exe">
        Allow from all
    </Files>
</Directory>

<Directory "/xampplite/cgi-bin">
    <FilesMatch "\.php$">
        SetHandler cgi-script
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler None
    </FilesMatch>
</Directory>

<Directory "/_projects/xampp">
    <IfModule php5_module>
        <Files "status.php">
            php_admin_flag safe_mode off
        </Files>
    </IfModule>
    AllowOverride AuthConfig
</Directory>


<IfModule alias_module>
    Alias /security "/xampplite/security/htdocs/"
    <Directory "/xampplite/security/htdocs">
        <IfModule php5_module>
            <Files "xamppsecurity.php">
                php_admin_flag safe_mode off
            </Files>
        </IfModule>
        AllowOverride AuthConfig
   </Directory>

    Alias /licenses "/xampplite/licenses/"
    <Directory "/xampplite/licenses">
        Options +Indexes
        <IfModule autoindex_color_module>
            DirectoryIndexTextColor  "#000000"
            DirectoryIndexBGColor "#f8e8a0"
            DirectoryIndexLinkColor "#bb3902"
            DirectoryIndexVLinkColor "#bb3902"
            DirectoryIndexALinkColor "#bb3902"
        </IfModule>
   </Directory>

    Alias /phpmyadmin "/xampplite/phpMyAdmin/"
    <Directory "/xampplite/phpMyAdmin">
        AllowOverride AuthConfig
    </Directory>

    Alias /webalizer "/xampplite/webalizer/"
    <Directory "/xampplite/webalizer">
        <IfModule php5_module>
            <Files "webalizer.php">
                php_admin_flag safe_mode off
            </Files>
        </IfModule>
        AllowOverride AuthConfig
    </Directory>
</IfModule>


#
# New XAMPP security concept
#

<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
    Order deny,allow
    Deny from all
    Allow from ::1 127.0.0.0/8 \
               fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
               fe80::/10 169.254.0.0/16

    ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>
#SetHandler application/x-httpd-php4_3
#SetHandler application/x-httpd-php4_4
SetHandler application/x-httpd-php5_4

how to use in .htaccess

Note