Closed kevin-j-morse closed 7 months ago
Thanks for reporting this issue, but as you rightly said, im no longer maintaining this code. Apache2buddy is getting less and less relevant these days with moves to worker mode and PHP-FPM. Apache2buddy was only ever written to support mod-php /apache and hardly anyone uses it these days, so Ive stopped maintaining it. However I am glad you fixed it and you are welcome to fork it and maintain a version that works for you. I dont intend to support multiple PHP versions on one box, apache2buddy wasn't meant to be PHP-centric, so its becoming less and less relevant with these more complex setups.
On a Ubuntu LTS system that has been upgraded from e.g. 20.04 to 22.04 there will often exist multiple versions of PHP
20.04 uses PHP 7.4, 22.04 uses PHP 8.1, and 24.04 will probably use 8.3
get_php_setting
breaks in this case because after locating/etc/php/7.4/cli/php.ini
the script sees the/cli/
and then starts looking for anotherphp.ini
. It is the search for anotherphp.ini
that is not quite working correctly.After checking for
/etc/php5/apache2/php.ini
the script correctly callsmy @files = glob "/etc/php/*/apache2/php.ini";
but in cases where there are more than one items in the list it incorrectly goes looking forglob "/etc/php/*/fpm/php.ini"
instead of using the last entry in the list by settingour $real_config = @files[-1];
This results in the message
The way I solved this is to remove all the code from lines 1350 to 1360 and replace with
our $real_config = @files[-1];
I think this would break in cases where someone has fpm installed because you would never search for the
glob "/etc/php/*/fpm/php.ini";
Maybe instead the if condition to search for fpm php.ini could be reached if the length of the list was 0 and if it wasn't then grab the last element of the list?
I realize this code is not being maintained but posting here in case this helps someone.