Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change php version in htaccess in server

I'm using php 5.3 on my local machine. On our webserver we have php 4.8. Our server is a shared server. So I want to change the php version on our server via .htaccess file. Is it possible to do it? If yes how to do it?

like image 353
jeeva Avatar asked Sep 24 '12 08:09

jeeva


People also ask

Can I update PHP version in cPanel?

Log in to cPanel. Select MultiPHP Manager in the Software section. Select the domain you want to upgrade by checking the box on its left side. Choose 7.4 or select the newest PHP version from the dropdown, then click Apply.

How do I update PHP version in control panel?

Log in to your one.com control panel. Scroll down to the Advanced settings tile and select PHP and database settings. Scroll down to Update PHP version. Select the PHP version you want to switch to and click Update.


1 Answers

To switch to PHP 4.4:

AddHandler application/x-httpd-php4 .php 

To switch to PHP 5.0:

AddHandler application/x-httpd-php5 .php 

To switch to PHP 5.1:

AddHandler application/x-httpd-php51 .php 

To switch to PHP 5.2:

AddHandler application/x-httpd-php52 .php 

To switch to PHP 5.3:

AddHandler application/x-httpd-php53 .php 

To switch to PHP 5.4:

AddHandler application/x-httpd-php54 .php 

To switch to PHP 5.5:

AddHandler application/x-httpd-php55 .php 

To switch to PHP 5.6:

AddHandler application/x-httpd-php56 .php 

To switch to PHP 7:

AddHandler application/x-httpd-php7 .php 

To switch to PHP 7.1:

AddHandler application/x-httpd-php71 .php 
like image 105
APeaze Avatar answered Sep 23 '22 02:09

APeaze