Swapping between php versions when using suPHP and CLI with custombuild
by admin on Oct.03, 2011, under DirectAdmin
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.
Incoming search terms:
addhandler directadmin,suphp update php version,suphp tutorial directadmin,suphp and different versions of php,suphp and cli,php suphp change version,multiple versions of php using htaccess suphp,install multiple versions of php using htaccess suphp,howto use suphp,forcing php5 cli,directadmin cli or cgi,directadmin change php version,direct admin suphp paranoid,cli script directadmin,change the php cgi version in directadmin,change php version with suphp,cgi cli php directadmin,swapping scriptRelated posts:
- Allow php scripts to work under ~username when using suPhp (custombuild) By default, suPhp is compiled in "paranoid" mode. This means...
- How to update to php 5 Note: If you want the latest version of php and...
- Running CGI script from any directory or via /~username/cgi-bin In order to force apache to allow cgi script to...
- How to modify the open_basedir setting for one domain. To change the open_basedir value when using php in CLI...
Related posts brought to you by Yet Another Related Posts Plugin.
