Ansible Role for PHP and PHP-FPM
This Ansible role creates PHP-FPM resource pool which is chroot'ed to the /var/www directory.
This and it's assumed/hard-coded chroot directory may not fit your needs.
This means that in PHP-FPM's eyes, the entire server is only what's inside of the /var/www directory.
This is good for security, but there are measurable conquences for this:
- A
/tmpdirectory for uploads must be accessible to PHP. - A sessions directory (I chose
/tmp/sessions) must be accessible for PHP - Timezone settings will give errors without
/usr/share/zoneinfofiles and possibly without/etc/localtimefile being accessible. - The usual
/dev/null,/dev/randomand/dev/urandom"special device files" may need to be accessible. In particular,/dev/urandomis used by Symfony's security classes to generate random numbers.
Note: All file paths above appear as so to chroot'ed PHP, but in reality live inside of the
/var/wwwdirectory. See thetasks/chroot.ymlfile to see that configuration being setup.