Swapping between php versions when using suPHP and CLI with custombuild


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » Apache Related Information » Php

Swapping between php versions when using suPHP and CLI with custombuildLast Modified: Jun 5, 2009, 12:47 am
If you have both suPHP and CLI installed on your system, but don't feel like renaming all of your file.php to file.php4 (for example), there is another means to chose between php versions, without requiring to touch your php files.

To force php files to use CLI (on the assumption your default php version uses suPHP) create an .htaccess file in your public_html directory, with the following:

<FilesMatch "\.php$">
AddHandler application/x-httpd-php .php
</FilesMatch>



To force php files to use suPHP (on the assumption your default php version uses CLI) use the following:

<FilesMatch "\.php$">
AddHandler x-httpd-php5 .php
</FilesMatch>

This last one is on the assumption that php 5 is suPHP and CLI is php4.  If php4 was suPHP, then you'd use x-httpd-php4 to force .php files to use suPHP with php 4.

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST