user12364517
user12364517

Reputation:

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

Upvotes: 0

Views: 6485

Answers (5)

Sharpminds
Sharpminds

Reputation: 8

If you are using XAMPP to install Akaunting, you can fix the "Ask your hosting provider to use PHP 7.2.5 or higher for both HTTP and CLI" error by changing the global PHP version.

To do this, follow these steps:

  1. Open the XAMPP Control Panel.
  2. Click on the "Config" button next to the PHP module.
  3. In the "PHP Configuration Editor" window, click on the "PHP" tab.
  4. In the "PHP Version" section, select "PHP 7.2.5 (or higher)".
  5. Click on the "Save" button.
  6. Click on the "OK" button.

Once you have changed the global PHP version, you should be able to install Akaunting without any problems.

If you are still having problems, you can try the following:

  • Make sure that you are using the latest version of Akaunting.
  • Try disabling all of your plugins and themes one at a time to see if one of them is causing the problem.
  • Reinstall Akaunting.

If you are still having problems, you can contact Akaunting support for assistance.

Here are some additional tips for troubleshooting Akaunting installation issues:

  • Check the Akaunting installation log file for any errors.
  • Make sure that you have the required PHP extensions installed.
  • Try increasing the memory limit for PHP.
  • Try disabling any security software that may be interfering with the installation.

I hope this helps.

Upvotes: -1

P. Lai Seng
P. Lai Seng

Reputation: 31

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

Upvotes: 1

TVDN
TVDN

Reputation: 315

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.

Upvotes: 3

Zeshan
Zeshan

Reputation: 1

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.

Upvotes: 0

user14593428
user14593428

Reputation: 1

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

Upvotes: 0

Related Questions