Install 2 versions of PHP in XAMPP

0

How can I install two versions of php in xampp? As you can see xampp has installed the PHP version 7.2 but unfortunately this is bringing complications when creating word documents with php, I use the PHPWord library because it is the only one that I have found free until now but I have realized that this library does not it is compatible with the php 7 version so I need to install another lower version such as php 5.6.

I want to know if you can help me with this, like installing another version of php in xampp

    
asked by 03.08.2018 в 17:20
source

2 answers

0

This link was useful for what I needed to do: link

    
answered by 06.08.2018 / 16:54
source
0

You can download the PHP versions you need and place them in your own directories, for example

c:\php5\

c:\php7\

All you need to do is tell your web server (Apache) which version of PHP to use, so it will load the appropriate module. In Apache you can do this by looking for the httpd.conf file and then editing the appropriate line:

LoadModule php7_module c:\php7\libphp7.so

You will have to discover the correct route, of course, this is just an example.

Save the httpd.conf and restart your server. Keep in mind that if you do not restart it, the changes will have no effect.

It is necessary to edit the .conf file and then restart Apache. Doing this only takes a couple of seconds, you can document which one you are also using in the file.

Use PHP 5:

LoadModule php5_module c:\php5\libphp5.so
#LoadModule php7_module c:\php7\libphp7.so

Use PHP 7:

#LoadModule php5_module c:\php5\libphp5.so
LoadModule php7_module c:\php7\libphp7.so

You do not need multiple versions of XAMPP, nor dual boot, nor use a different machine, nor any of the other "solutions" that have suggested complicated solutions. If you want to use XAMPP just tell what version of PHP to use. This is the fastest and most efficient way to do it, and it only requires a XAMPP installation.

    
answered by 03.08.2018 в 19:31