Report this

What is the reason for this report?

Akauting PHP Error

Posted on January 28, 2021

Hi!

I’m trying to update the Akauting software. I’ve just run the upgrade command in my Ubuntu 18.04.

However, the following errors don’t allow the complete Akatung update:

“You can not upgrade to Akaunting 2.1 version because your PHP version is lower than 7.3.0. Please, ask your hosting company to upgrade your PHP.”

and:

“The PHP CLI executable file is not working! Please, ask your hosting company to set PHP_BINARY or PHP_PATH environment variable correctly.”

How can I fix that? Thank you so much!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

As far as I can tell for the error that you are getting, you have to upgrade your PHP version. To do that you could follow the steps from this answer here:

https://www.digitalocean.com/community/questions/how-to-upgrade-php-7-0-33-to-7-4-7-on-ubuntu-16-04-nginx

Hope that this helps. Regards, Bobby

Thank you

To fix the errors encountered during the Akaunting update, follow these steps:


1. Upgrade PHP Version

Akaunting 2.1 requires PHP 7.3 or later. Your Ubuntu 18.04 currently has an older PHP version installed.

A. Add PHP PPA

To install or upgrade PHP to version 7.3 or later:

sudo add-apt-repository ppa:ondrej/php
sudo apt update

B. Install PHP 7.3 or Later

Install the required PHP version (e.g., PHP 7.4 for compatibility):

sudo apt install php7.4 php7.4-cli php7.4-fpm php7.4-mysql php7.4-xml php7.4-mbstring php7.4-curl php7.4-zip php7.4-gd

C. Set the Default PHP Version

Use update-alternatives to switch to the newer PHP version:

sudo update-alternatives --set php /usr/bin/php7.4

Verify the PHP CLI version:

php -v

2. Resolve the PHP CLI Error

Akaunting requires the PHP CLI executable to be properly configured. If you’re seeing “PHP CLI executable file is not working,” ensure the PHP binary path is correct.

A. Set PHP_BINARY or PHP_PATH

  1. Determine PHP CLI Path:
which php
  • Example output: /usr/bin/php

  • Set Environment Variables: Add the following lines to your web server or system environment configuration file:

export PHP_BINARY=/usr/bin/php
export PHP_PATH=/usr/bin/php

Save and apply the changes:

source ~/.bashrc

B. Test PHP CLI

Run the PHP command manually to ensure it’s working:

php -v

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.