Scott McEachern wrote:

> And here's where it can't find the file:
> 
>   23595 php-fpm-5.3 GIO   fd 2 wrote 100 bytes
>         "ERROR: Unable to open primary script:
> /var/nginx/html/who_is_online.php (No such file or directory)
>         "
 ...
> 
> This problem is a real mystery to me, and I'm hoping I didn't miss
> something crazy-simple.  Can anyone explain it?
> 

I'm not familiar with nginx but in general, the crazy-simple explanation I
can think of is that you're running from a chroot.

So the daemon will look for files relative to its chroot.

> 
> I stuck with the default php-fpm.conf file, except changing the
> user:group to _nginx and the chroot dir, so I'll just post a diff:
> 
> <snip>
> # diff php-fpm.conf php-fpm.conf.dist
> 132,135c132,133
> < ;user = www
> < ;group = www
> < user = _nginx
> < group = _nginx
> ---
>  > user = www
>  > group = www
> 442,443c440
> < ;chroot = /var/www
> < chroot = /var/nginx
> ---
>  > chroot = /var/www
> </snip>
> 
> 

If the file on your file system is /var/nginx/html/who_is_online.php, a
daemon chrooted to /var/nginx will see it as /html/who_is_online.php.
If the daemon chrooted to /var/nginx should really
see /var/nginx/html/who_is_online.php, the file should live
in /var/nginx/var/nginx/html/who_is_online.php on your file system.

Hope this helps.

Reply via email to