[solved] PHP Warning: Unable to determine version

Describe the problem you’re having:

Well I made the mistake of trying to upgrade my bootleg FreeBSD ttrss server. A bunch of packages got upgraded and I wound up with php 7.2 and Postgresql 11 (which was an absolute nightmare, but seems to be migrated from 9.5 now). When I load the tt-rss webpage I see this in my system messages:

[Tue Jun 23 09:45:21.242044 2020] [php7:warn] [pid 8857] [client 192.168.13.13:24068] PHP Warning: Unable to determine version (using /usr/local/www/apache24/data/tt-rss): RC=127; OUTPUT=sh: git: not found in /usr/local/www/apache24/data/tt-rss/include/functions.php on line 1921

If possible include steps to reproduce the problem:

> be me
> so dumb I hosted this thing on FreeBSD

Edit: possible information to reproduce problem in additional info section below.

tt-rss version (including git commit id):

Well… That’s topical.
Manually running the command works fine:

git --no-pager log --pretty=“version: %ct %h” -n1 HEAD
version: 1592922912 db473c2d0

Platform (i.e. Linux distro, PHP, PostgreSQL, etc) versions:

FreeBSD 11.3
PHP 7.2
Postgresql 11

Please provide any additional information below:

I found a similar post: Warning in update_daemon2.php output
And decided to edit /usr/local/www/apache24/data/tt-rss/include/functions.php to have the full path to git, so that line 1921 became:

exec(‘/usr/local/bin/git --no-pager log --pretty=“version: %ct %h” -n1 HEAD 2>&1’, $output, $rc);

And now it works fine. So somewhere I have my PATH for php screwed up, but so far haven’t been able to figure out how to correct it.

neverending shit like this (especially issues related to portupgrade which is a nightmare in itself) is why i’m glad i no longer use freebsd in production.

also, apache on top of freebsd with php loaded as a module. deliciously vintage setup. :star_struck:

anyway, right way to set PATH for startup scripts | The FreeBSD Forums try this

My hero :heart:

I was dorking around with php config files, but adding the path to apache’s envvars did the trick. And the crusty server trundles forward into the future!

New file:

# cat /usr/local/etc/apache24/envvars.d/path.env
PATH=$PATH:/usr/local/bin