XAMPP change PHP version - php

I am working on an older project that uses functions not supported by the newer PHP version included in my version of XAMPP.
I want to temporarily change to an older version of PHP, so I'm looking for a way to switch between PHP versions in XAMPP.
Unfortunately, refactoring to use the newer version of PHP is not an option.

I would not dare to 'temporarily' shift my development machine.
I would suggest installing a virtual machine manager like VirtualBox and then install a older version of XAMPP in there.

I am really disappointed with the responses on this.
WAMP allows you to switch between PHP and MySQL versions pretty easily...

I did following steps on Windows:
Download your XAMPP with your desired PHP version (the VC-11.zip version)
Unzip on C:/xamppXXXX/ (XXXX -> Your PHP version, for example), so you'll have both C:/xampp/ (your first installed version) and the new.
3a. Find in all .conf, .ini, .bat files from the xamppXXXX folder /xampp/ and replace for C:/xamppXXXX/. You can use any IDE like SublimeText to find the string.
3b. Find in all .conf files from the xamppXXXX folder \xampp\ and replace for \xamppXXXX\
You can start MySQL from your installed version control panel and open the C:/xamppXXXX/xampp-control.exe and launch Apache from this one.
I did this with php7 installed and php5 from zip and working fine. Opening different instances of XAMPP Control Panel is the best way to have all databases together and not losing them between versions.

Dont' use XAMPP for this. Use MAMP. It's a single click

Related

Is it posible to copy/paste xampp folder and make it work in another computer?

I have a xampp server in a laptop with an application running as development environment, and I need to move all the server to a new computer.
Will it work if I copy/paste the complete xampp folder from one to another, or is it needed to "install" xampp from the installation package in the new computer?
I need it to be the exact version because productive environment does not support a newer version of PHP (actual version is 5.5.11).
I already tried downgrading a xampp installation but it seems that I need to install also the xampp version that supports the PHP version.
I did not succeed on finding that specific version of PHP on surceforce.
Any clues would be appreciated.
I think you should consider to use VirtualBox or/and Docker for future :)
So I've figured out it can be done. I installed the newest version then copied all config folders from my actual version along with all my files.

Update or replace PHP in Apache XAMPP withouth reinstalling Apache

My question is simple: how to update PHP in Xampp withouts reinstallation? Current PHP version is 7.1.1
I have tried the following:
downloaded thread-save and non thread safe versions, extracted them in php and then replacing php.ini with older version
Copied all directories which are not in updated verion
answers from Upgrading PHP in XAMPP for Windows?
second answer from Upgrade PHP on XAMPP 1.8.3 windows 7 installation
Because Laravel requires newer versions every few weeks i would consider updating just php rather than Xampp itself.
The question is what is the best way to manage PHP versions withouth reinstalling Apache server? I need specific version because of software specifications
As #IgorIlic mentioned, one of the options is to setup different versions on different ports.
The other option would be to change PATH value, which points to PHP installation. Just edit the line and change it to version that you require.

Is there a way to run PHP version 5.4 w/ the latest MAMP version

I have the latest version of MAMP installed but i want it to run PHP version 5.4.
That version is included in the MAMP file dir. It is located…
-> bin/php/php5.4.42
but in the preferences pane there are only 2 PHP version options: 5.6.10 and 7
I want to do this a part of troubleshooting. i have a Drupal install and am getting the dreaded ‘White Screen of Death’. I’m trying anything and everything to get it working!
MAMP lets you choose from the last two versions of PHP installed in bin/php. If you want to use 5.4.42, just leave this folder and another one of your choice inside this directory (move the others somewhere else so you have a copy, just in case). When you restart MAMP you'll be able to choose your preferred PHP version in the Preferences.
You can download more versions at https://www.mamp.info/en/downloads/
The easier way is to use other localwebserver called Ampps, and after installing it you can choose the version you want by the simple interface it provide.
You click on PHP ==> Change PHP version, and it will show you versions from 5.3 to 7.0.
Here is the link: http://www.ampps.com/
Thanks a lot.

Upgrade PHP on XAMPP 1.8.3 windows 7 installation

I have XAMPP 1.8.3 installed on my windows 7 machine. Which include PHP 5.5.6. I want to upgrade the PHP to 5.6 version. Is it possible to do the upgrade while keeping the XAMPP bundle other module as it is (Apache, MySQL). Can any one suggest a way to do upgrade on windows 7.
Download the package from following url:
http://windows.php.net/download/. Make sure the “Thread Safe” zip
file with around 20MB was downloaded.
Extract and rename the folder to “php”.
Rename the existing “php” folder to something and place the new
bundle with folder name “php”.
Then restart the apache server. It will simply load the new PHP
version.
Try like this:
How to upgrade php in xampp:-
Lots of time you need to use multiple version of php for your
different project. In this case either you want to install xampp on
different port or you can install one xampp and upgrade php. In this
article I will demonstrate how you can upgrade php in your xampp
server. I will demonstrate the complete process by adding PHP 5.4
with XAMPP. Following is the step by step process of upgrading php
in your xampp server. Before trying these steps please take complete
backup of your code and database alognwith xampp because any small
mistake can lead to the corruption of your regular XAMPP.
Upgrade PHP in XAMPP server
Download PHP : If you are using xampp ofcourse you are using windows operating system. So first download your desired version of php binary from http://windows.php.net/download/ website. Be careful while choosing binary. If you are using XAMPP then your webserver is apache. So always download Thread Safe binary. Also read the compiler suggestion carefully on the windows.php.net site. I will recommend to download zip version.
Configure New PHP Version with your xampp: Unzip the downloaded version of the PHP in a separate folder. Please make sure that your new php folder name is not “PHP”. May be you can use folder name as the version name. For example for php 5.4 you can use php54. Copy the new php folder into your xampp folder. Now go to yourxampp/apache/conf/extra folder. Open file httpd-xampp.conf from the folder extra. Change the following variables:
Variable PHPINIDir to be your xampp folder new version of PHP
Varaible LoadModule to be your xampp folder/new version of PHP/php5apache2_2.dll
Save the file httpd-xampp.conf. Restart your XAMPP apache server. If your server get restarted successfully then your server php version is upgraded. You can check the status of your php version by URL http://localhost/xampp/phpinfo.php .

Change PHP version in IIS 6

Trying to upgrade from PHP 5.2.5 to 5.2.17 (and then to 5.3.6 once that works) on IIS 6.0, installing the language itself runs just fine and I changed the PHP.ini/ect locations that IIS uses for PHP, everything still works but when I run PHP info on my site it still says it's running PHP 5.2.5. Restarted IIS, restarted the server even, no difference. What do I do to change which version/what location of PHP IIS is using?
When I install PHP 5.3.6 the site no longer works, so I know installing different versions is doing SOMETHING, but I think it might only be changing the PHP.ini my server is using, not the version of PHP.
In addition to installing the windows binary release of PHP I've also tried installing PHP from Microsoft's Web Platform Installer (both 5.3.6 and 5.2.17), after installing neither showed up as the current version in phpinfo either.
If you want to use php 5.3, you must install IIS FastCGI extension and run PHP as cgi script. From php 5.3 isapi is not supported. But everything works fine if you configure it, and as benefit you can use more php version simultaneously. IIS 6 is not a problem. Download PHP non thread safe.
For details see this, for example: http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/
Download the latest VC11 x86 Non Thread Safe version of PHP from http://windows.php.net/download/
Once the zip is downloaded, right click on the zip file and select properties. Make sure you unblock the file.
Rename your current PHP folder to PHPold.
Find your php.ini file and rename it to phpold.ini
Extract the zip file to c:\temp\php.
Copy the php folder from c:\temp to wherever your old PHP folder was.
Go to your new php folder and copy php.ini-production and paste it to where your old php.ini file was
Rename php.ini-production to php.ini
On the server, make sure you have Notepad++ along with the Compare plugin. If you need the compare plugin, use these steps. http://www.davidtan.org/how-to-compare-two-text-files-using-notepad-plus/
In the location that stores your phpold.ini and php.ini, right click on each of those files and open them with Notepad++. On the php.ini, only make changes to the lines with the >> next to them.
Once the changes have been made, make sure you save php.ini.
Go to Services and restart IIS.
Solution has been to move to Apache in my case. IIS 7 has better tools but IIS has proven to be a poor environment for development in this case.

Categories