Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change PHP version on server using either .htaccess or php.ini

How can I change the PHP version to 5.2 on a server using either an .htaccess of php.ini file?

like image 801
Anriëtte Myburgh Avatar asked Aug 24 '12 08:08

Anriëtte Myburgh


People also ask

Can I change PHP version in htaccess?

Locate the . htaccess file, right-click on it, and select edit. At the top of the file, insert the PHP handler for the version you would like to use. If there is a handler in the file already, it should be removed or replaced with your new handler.

What is PHP INI and .htaccess mention their difference?

ini is used for the whole server while the configuration in a . htaccess file is only used when a request goes to the directory or subdirectory the . htaccess file is located in. So you can have a global or default configuration in your php.


Video Answer


1 Answers

Adding

AddHandler application/x-httpd-php52 .php .php5 .php4 .php3

to your .htaccess might work.

like image 159
Wayne Whitty Avatar answered Oct 05 '22 03:10

Wayne Whitty