Slashbunny / puppet-phpfpm

Manages php-fpm daemon and pool configuration
GNU General Public License v3.0
10 stars 29 forks source link

Error to reload FreeBSD service php fpm #45

Closed gnomii closed 1 month ago

gnomii commented 1 month ago

HI,

There was a commit on PHP packages to be compliant with the RC script recommandation, rename php-fpm to php_fpm for PHP 8.X version.

Since this commit, there is an error while reloaded the fpm service :

Error: /Stage[main]/Phpfpm::Service/Service[php-fpm]: Could not evaluate: Could not find init script for 'php-fpm'

Can you check please ?

Slashbunny commented 1 month ago

The FreeBSD configuration is here:

https://github.com/Slashbunny/puppet-phpfpm/blob/97c4cc6572211f536155e6669f892fb7bb3ea6d1/manifests/params.pp#L336-L346

However, there is nothing there specifying the versions of FreeBSD. That particular code has been there for ages and still likely tries to install the php70 package, regardless of the version of FreeBSD. In what version of FreeBSD did 8.x become standard? Is there somewhere to see what versions of FreeBSD came with which versions of PHP?

gnomii commented 1 month ago

Php7x and Php80 were removed from port collection, you can not install this version directly and you need to specify the version that you want. There is no specify version of FreeBSD to switch to Php 8x

I use your module like this to avoid error with php70

class { 'phpfpm': poold_purge => true, package_name => php82, ensure => 'installed', manage_package => true, }

I see this evening I can set the "service_name" to "php_fpm" and this fix the error.

I suggest to set php82 for default version and service_name" to "php_fpm".

Thank you.

Slashbunny commented 1 month ago

Yes, you can just override those variables yourself, so that fixes your problem. I'll do a bit more research and modernize the defaults at some point in the future. Thanks for the information!