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

Can't create pid file for php7.0-fpm, because php__run_base directory hasn't been created. #24

Open
beata opened this issue Jan 9, 2017 · 3 comments

Comments

@beata
Copy link

beata commented Jan 9, 2017

For PHP7 and above, the pid file would be placed in /run/php, which hasn't been created on filesystem. Thus NGINX can't work with PHP-FPM.

templates/etc/php/fpm/php-fpm.conf.j2
20:pid = {{ php__run_base }}/php{{ php__version }}-fpm.pid

env/tasks/main.yml
76:    php__run_base: '{{ "/run/php"
77-                       if (php__version | version_compare("7.0", ">="))
78-                       else "/run" }}'
@drybjed
Copy link
Member

drybjed commented Jan 9, 2017

What OS distribution and release do you use? Do you use PHP7 from Sury repositories? It might be an issue with the PHP7 package not adding the required directory entry in /run/.

@beata
Copy link
Author

beata commented Jan 10, 2017

Here's my environment variables:

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty

# Custom variables
php__sury: True
php__packages: [ 'mysql', 'xml', 'mbstring', 'zip' ]
php__production: True
php__ini_cgi_fix_pathinfo: False # nginx should have the option disabled
php__ini_post_max_size: 16M
php__fpm_listen_owner: www-data
php__fpm_listen_group: www-data
php__fpm_pm: dynamic

@drybjed
Copy link
Member

drybjed commented Feb 21, 2017

The /run/php/ directory is created on systemd-based hosts by the /usr/lib/tmpfiles.d/php7.0-fpm.conf file. This requires a systemd init to work. I'm not sure how that was done under sysvinit hosts, probably via the init script itself. Still, that should be solved by the package maintainer. Perhaps it's time to consider an upgrade, at least to latest Ubuntu 16.04 LTS release? It should work fine there.

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

2 participants