Open eethann opened 10 years ago
which vm box you've used?
Same issue here. CentOS6.4, custom build minimal installation but only Chef installed on top of it. Using Epel -repos if that matters.
@eethann @n1koo Just including the recipe won't install proper configs. Create another recipe for creating the pool: include_recipe 'php-fpm' php_fpm_pool "www"
Yeah, noticed that. I don't know why the service is started in the default recipe. Since at that point it shouldn't actually have any pools. I'm just about to start changing the default action to :nothing. After creating the pool the service is restarted anyways, so that should work.
@n1koo I've foked this and added pool creation in the default recipe. You can configure it as well. https://github.com/spinx/cookbook-php-fpm
Pull request: https://github.com/yevgenko/cookbook-php-fpm/pull/27
Looks nice, but doesn't the fpm process still get started before creating the pools? I'm the process of testing out zabbix, and this how they use it ( https://github.com/laradji/zabbix/blob/master/recipes/web_nginx.rb ).
Afaik, this should be totally legal. No usage of the default www-pool, start php-fpm after that custom pool has been added.
I'm also on CentOS 6.4, provisioning with chef-solo. Spinx's pull request #27 looks like exactly what I'd need. Will test.
i also got hit this problem that php-fpm is attempted to start before config from lrwp is written down, and thefore whole recipe fails because service php-fpm is not started.
for me the error was:
[12-Dec-2013 14:41:03] WARNING: Nothing matches the include pattern '/etc/php/fpm.d/*.conf' from /etc/php/php-fpm.conf at line 16.
[12-Dec-2013 14:41:03] ERROR: No pool defined. at least one pool section must be specified in config file
[12-Dec-2013 14:41:03] ERROR: failed to post process the configuration
[12-Dec-2013 14:41:03] ERROR: FPM initialization failed
i think the simpliest is action :nothing in recipes/default.rb and rely on notification to start it
Sorry guys, that was my doing. I think that enabling (but not starting) PHP-FPM is ideal, and that a (delayed) notification starts/restarts it when a pool is added. I don't know about adding a default pool since most folks would probably want to 'enable false' it and add their own. The 'standard' with cookbooks in general seems to go against auto-adding things you later remove.
ameir: not following what you are saying with your last commit, you mean PR #29 is ok you to be merged?
mabye selinux, execute "setenforce 0" and try again
Not sure if this is relevant for you guys, but I've run into this error a lot and there's no good info anywhere else, so here's a better tip than "setenforce 0" if you're on Ubuntu:
sudo aa-complain /usr/local/bin/php-fpm
/usr/local/bin/php-fpm
I have installed php-fpm via chef in vagrant using just "add_recipe 'php-fpm'". The basic install seems to work but the system fails when starting up the service. The error given is:
I saw that the path of the include directive in php-fpm.conf is wrong, it is currently pointing to
/etc/php-fpm.d/pools/*.conf
but there is no pools directory inside/etc/php-fpm.d/
. Changing the include path in the conf file to remote "/pools" allows the service to be started.