Skip to content

"Bad gateway" with nginx, PHP-FPM using FreeBSD socket

Apparently there is a bug in the PHP version shipped with FreeBSD; ServerFault user MafiaInc kindly provided the solution:

  1. Edit the file /usr/local/etc/php-fpm.conf

  2. Note the values of the user/group lines, e.g.:

    user = www
    group = www
  3. Add these lines with the same values as the user/group lines:

    listen.owner = www
    listen.group = www
  4. Restart PHP-FPM using this command:

    Terminal window
    service php-fpm restart