Change php version through .htaccess

If there are two php versions compiled on server and you wish to use php version for your domain other than the default one then make the  use .htaccess for this.

For example default php version on server is set to php 4 then all domains by default will use php4.  But certain applications installed on a domain runs only under php5 then in that case it is necessary that domain should use php5

Open .htaccess by any suitable editor like vi, pico etc. Put the following code into it.

Server without suphp enabled

AddType application/x-httpd-php5 .php .htm .html

Server with suphp enabled

AddHandler application/x-httpd-php5 .php .htm .html

Same way you can enable php4 if the default php version is php5. Just put the php4 instead php5 in above code.

 

 

Related Posts:

  • No Related Posts

Comments are closed.