'How to fix this error : Ask your hosting provider to use PHP 7.2.5 or higher for both HTTP and CLI?

I am facing the issue while setup the Akaunting application. I cloned this repo from GITHUB source 1: https://github.com/akaunting/akaunting. I followed all the steps and fulfilled all requirements, but when I serve this project it can show me this error on the screen (Error: Ask your hosting provider to use PHP 7.2.5 or higher for both HTTP and CLI.). My Php version is 7.4.10. Please help me out on how to fix this issue?

enter image description here



Solution 1:[1]

So there may be many, many reasons for this issue, hopefully one answer will resolve it for you. In my case, I had to do 2 things:

  1. Change the Global PHP version as stated by Zehsan;
  2. In the address bar, I replaced "requirements" with "language";

So for part 2:

  • my.akaunting.com/install/requirements

would become:

  • my.akaunting.com/install/language

Like this you should skip to the wizard and select the language setting.

I hope this helped!!

Cheers.

Solution 2:[2]

The reason why for this error is because Akaunting is using command line (CLi) php to get your installed php version instead of universal accepted method of getting php version through built in phpinfo().

Because it's using CLi php it might not work properly with xampp or any other php hosting server that did not configure the right path to php binary in the environment variables

To fix this in windows, locate php.exe most probably in [pathTo]\xampp\php\php.exe and add them into your windows environment variables . Launch cmd and execute this

setx PATH "%PATH%;drive:\path\to\your\php.exe"

To fix this in Linux, locate php binary path, most probably at in [path]/bin folder`. Launch Shell/bash

export PATH=$PATH:/place/with/path/to/php

restart your web server to refresh the new environment PATH

Solution 3:[3]

I had a similar issue. I got is resolved by doing the following.

  1. Open the .env. testing file and add the location of your php.exe like below
    PHP_BINARY="C:/xampp/php/php.exe"
    
  2. Save the file as .env
  3. Refresh your installation page

Solution 4:[4]

You need to check the PHP version globally and in the project directory.
This error appears when there is a difference in PHP Version of these folders. In my case reinstalling the composer did the trick.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TVDN
Solution 2 P. Lai Seng
Solution 3 powers
Solution 4 Zeshan