I am testing a Custom Module on Magento 2.1.12 and Magento 2.2.3, I am using Lampp with php version 7.1.3, which is supportive for magento 2.2.3 but not for magento 2.1.12.
What is the solution for this problem?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
I'd strongly recommend NOT to simply take the short answer, which appears to be 7.0.2, 7.0.4, 7.0.6–7.0.x.
There are other factors that may play into the compatibility, and to simply ask, "...which PHP version works for...?", would be an answer for some but not for others.
You should refer to documentation Magento has provided through their DevDocs. In addition to listing compatible versions of PHP that Magento2 can handle, PHP configuration settings that are recommended or required are listed too.
Please keep in mind that there are other solutions beyond trying to find a single version of PHP for them. Multiple versions of PHP can be used on the same server but differ across vhosts, for example. Try reading something like this: https://medium.com/@sbuckpesch/run-multiple-php-version-on-the-same-server-using-php-fpm-and-xdebug-on-ubuntu-16-04-6a84f5b7d7ce