Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

PHP_BINARY or PHP_PATH

Caras   ( User )

Commented 3 years ago

Hey Sabri,
Actually that's what I thought. I opened and ran the files just like wordpress installs. I'm running it on Windows . I didn't make any additional adjustments. I made a little adjustment on the Apache. (mod_rewrite) I haven't done any other editing. How am I going to do this:) you must be the one to help me :)

Caras   ( User )

Commented 3 years ago

I write down what I've tried and what I've been through. I hope someone will help.

1-First I tried changing the environment file name.
".env.example" to ".env" - is it resolved? No

2- There was something worth APP_KEY in the .env file. I deleted the data there.
is it resolved? No, but the error message has changed.
"No application encryption key has been specified."

I have no other idea. I don't even have a resource to look at.

Caras   ( User )

Commented 3 years ago

Hey, dis is okay.
That's it. It's very simple. I added something like this under the media file.

PHP_PATH='C:\AppServ\php7\php.exe'

Thanks for all.

Denis Dulici   ( Admin )

Commented 3 years ago

Hello,

As I said before, that's totally related to the PHP CLI executable configuration of your host/server.

Regards

Usoft Solutions   ( User )

Commented 3 years ago

The PHP CLI executable file is not defined/working or its version is not 7.2.5 or higher! Please, ask your hosting company to set PHP_BINARY or PHP_PATH environment variable correctly.

Hello,
I have same error and i do not seem to find the .env file almost everyone is talking about. I only have ".env.testing" and ".env.example", which of these files are you talking about?
I have used a lower version and it worked fine but this one seem to be a lot of work to install. I am installing on Windows using Xampp with Apache version 2.4.43 and PHP version 7.4.5

Kindly help with, it's no more funny.

Usoft Solutions   ( User )

Commented 3 years ago

I finally got it.
On windows, you only need to add the PHP path to your system path under environment variables.

1. click start
2. right-click computer
3. click properites
4. click advanced system settings tab
5. click environment variables
6. find PATH in the system variables box, and add the following path:
;c\:xampp\php to the end of PATH variable string.
find PATHEXT in the system variables box and add the following extension:
;.php to the end of the PATHEXT variable string

It worked for me

Dane   ( User )

Commented 3 years ago

I spent a lot of time debugging this. The error is caused by the following lines in app\Utilities\Installer.php

if (Console::run('help') !== true) {
$requirements[] = trans('install.requirements.executable', ['php_version' => AKAUNTING_PHP]);
}

On Windows, this tries to run a command to check if the php-cgi executable (as specified by PHP_BINARY) is working ok. The command generated looks like this:

cmd /V:ON /E:ON /D /C ("C:\Program Files\PHP\v7.4\php-cgi.exe" artisan help) 1>"C:\Windows\TEMP\sf_proc_00.out" 2>"C:\Windows\TEMP\sf_proc_00.err"

The problem is that PHP has been installed to a path which has spaces in it ("Program Files"), and the command does not execute properly. In my case I solved this by changing the following line (around line 1541) in the Symfony framework "vendor\symfony\process\Process.php" from

$cmd = 'cmd /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')';

to

$cmd = 'cmd /V:ON /E:ON /D /C "'.str_replace("\n", ' ', $cmd).'"';

I haven't completed the installation process, so there may still be other problems, but this has at least gotten me past the initial problem.

It may also be possible to solve the issue by installing PHP under a directory which does not have spaces in the name. Perhaps there is also some other better way :-).


Denis Dulici   ( Admin )

Commented 3 years ago

Hello Dane,

It seems you've tried hard. What was the generated command after that change?

Regards

Dane   ( User )

Commented 3 years ago

Hi Denis

The command then becomes:

cmd /V:ON /E:ON /D /C ""C:\Program Files\PHP\v7.4\php-cgi.exe" artisan help" 1>"C:\Windows\TEMP\sf_proc_00.out" 2>"C:\Windows\TEMP\sf_proc_00.err"

It's just that the brackets are replaced with quotes. This worked for me and Akaunting is running fine now, however I'm not sure if there might be other side effects (I don't think so though). It seems that the installer uses this command as a check to see that PHP is installed ok, by simply evaluating whether it ran without error or not (it does not actually look at the output).

As a side note, I was installing Akaunting in order to evaluate it. Akaunting looks very nice but at this stage still seems to be lacking some of the features we need, paid add-on or otherwise, mostly good detailed reports with "drill-down" facility. Also we need bi-monthly tax reports, and it seems that only monthly/quarterly/yearly reports are supported. I'm not sure if there is any way to evaluate add-ons without purchasing them, perhaps the Double-Entry add-on improves some of these features. If I have time then I might look at developing them if necessary :-).

Jeffrey Darraugh   ( User )

Commented 1 year ago

same problem on centOS 7 - php path is set correctly and still get the error. I even set paths in .env. When you set debugging to "true" in .env, there are a bunch of errors indicating that the app is using a lot of deprecated functions and declarations..... Laravel strikes again!!!

Please login or register to leave a response.

Showing 11 to 20 of 20 discussions