Search code examples
apachexampp

How to run multiple PHP version with XAMPP?


I have multiple projects based on PHP. Some require PHP version 5.x to run and other strictly require PHP 7.0 or above. I am working on these simultaneously. Is there a way to run multiple PHP versions such that I can switch between them when working on different projects.


Solution

  • Try these steps:

    1. Stop LAMP if running.

    Download libphp7.so if you don't have

    https://github.com/prashant-techindustan/php7module_library/blob/master/libphp7.so

    1. Edit /opt/lampp/etc/extra/httpd-xampp.conf (Comment out one of the following which is not needed):

      LoadModule php5_module modules/libphp5.so

      LoadModule php7_module modules/libphp7.so

    2. Start LAMP