Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong includes directory in php_fpm.conf after vagrant install #26

Open
eethann opened this issue Dec 6, 2013 · 12 comments
Open

Wrong includes directory in php_fpm.conf after vagrant install #26

eethann opened this issue Dec 6, 2013 · 12 comments

Comments

@eethann
Copy link

eethann commented Dec 6, 2013

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:

Starting php-fpm: [06-Dec-2013 07:40:51] ERROR: Unable to globalize '/etc/php-fpm.d/pools/*.conf' (ret=2) from /etc/php-fpm.conf at line 11.
[06-Dec-2013 07:40:51] ERROR: failed to load configuration file '/etc/php-fpm.conf'
[06-Dec-2013 07:40:51] ERROR: FPM initialization failed

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.

@yevgenko
Copy link
Owner

yevgenko commented Dec 6, 2013

which vm box you've used?

@n1koo
Copy link

n1koo commented Dec 7, 2013

Same issue here. CentOS6.4, custom build minimal installation but only Chef installed on top of it. Using Epel -repos if that matters.

@spinx
Copy link
Contributor

spinx commented Dec 8, 2013

@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"

@n1koo
Copy link

n1koo commented Dec 8, 2013

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.

@spinx
Copy link
Contributor

spinx commented Dec 8, 2013

@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: #27

@n1koo
Copy link

n1koo commented Dec 8, 2013

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.

@eethann
Copy link
Author

eethann commented Dec 10, 2013

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.

@glensc
Copy link
Contributor

glensc commented Dec 12, 2013

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

glensc added a commit to glensc/cookbook-php-fpm that referenced this issue Dec 12, 2013
starting fpm from recipe makes initial installs to fail when config is
incomplete.

starting fpm service is handled from lrwp notification so starting from
recipe is not really neccessary.
@ameir
Copy link

ameir commented Dec 12, 2013

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.

@glensc
Copy link
Contributor

glensc commented Dec 13, 2013

ameir: not following what you are saying with your last commit, you mean PR #29 is ok you to be merged?

@luxin88
Copy link

luxin88 commented Jul 17, 2015

mabye selinux, execute "setenforce 0" and try again

@dagelf
Copy link

dagelf commented Feb 21, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants