how do you switch php version?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

how do you switch php version?

Postby Alistair » 03. January 2010 11:28

I need to go back to php 5.2 but a research in Internet wan't useful to me and for the life of me just cannot understand how I can swith from php 5.3 to 5.2, anyone can give me a comprehensible step by step guide?
Alistair
 
Posts: 10
Joined: 11. December 2009 09:13

Re: how do you switch php version?

Postby Izzy » 03. January 2010 23:23

What XAMPP version have you currently installed and which Windows OS are you using?

You may have to uninstall XAMPP and download and install a previous version 1.7.1 for example has PHP 5.2.9 - this info can be found in the version readme_en.txt files.

Older versions can be downloaded from the XAMPP For Windows SourceForge repository:
http://sourceforge.net/project/showfiles.php?group_id=61776&package_id=89552
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: how do you switch php version?

Postby Alistair » 04. January 2010 08:14

What? There is no way I'm uninstalling xampp, there must be an easier way, I found these instructions but still struggling, let alone if I had to reinstall xampp altogheter...

How to switch to a different PHP version?

SiteGround has implemented a unique server setup that allows each customer to choose which version of PHP to use for his / her account. What is more, the customer can even use different PHP versions for different directories in one and the same hosting account. The PHP versions currently supported are: PHP 4.4 PHP 5.0, PHP 5.1, PHP 5.2, PHP 5.3, PHP 6.0 and a special secure version of PHP 5.2 with Suhosin patch.

In order to change the PHP version for your account, follow these steps. Go to cPanel, File Manager and choose "Web Root (public_html/www)". There create a new file (or edit the existing one) called .htaccess and add the following line:



To switch to PHP 4.4:

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



To switch to PHP 5.0:

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


To switch to PHP 5.1:

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



To switch to PHP 5.2:

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



To switch to PHP 5.3:

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



To switch to PHP 6.0:

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



To switch to the secure PHP 5.2 with Suhosin patch:

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



This setting will apply recursively to all of the subdirectories. In case you'd like to have a different version of PHP in a subdirectory, create a new .htaccess file in it with the directive for the desired PHP version in it.
Alistair
 
Posts: 10
Joined: 11. December 2009 09:13


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 137 guests