Hi ninja community?
I have debian 10 OS and nginx as web server. I followed Install Invoice Ninja v5 on Ubuntu 20.04
to install ninja invoice. But I am getting following errors in my server error log.
connect() to unix:/run/php/php-fpm.sock failed (2: No such file or directory) while connecting to upstream ninja invoice
Please help me to fix it. Thanks & Regards!
Can you check the statuses of php-fpm & nginx?
sudo service nginx status
sudo service php-fpm status
Yes, I have checked the status of both services i.e. nginx and php7.3-fpm but both are up and running.
One of two things, either that is not the path for php-fpm.sock, and you should edit the path in nginx config. Otherwise it is permissions. Verify that the file at that path exists (only exist while service running). Then check permission. Php config can help set default permissions of a sock file, since it respawns with default every time you reboot or restart the service.
The Ubuntu instructions are highly streamlined because of effective default configs that I assume don’t exist in Debian or are just different.
Systemctl status php-fpm will tell you the path of current php .sock file and its name (sometimes www.sock). Verify that path, and configure nginx accordingly and verify nginx has permission to the sock file.
See my CentOS guide which already has examples of these steps, you will have to adapt them to your environment.
I have checked your suggested solutions but now start getting following error.
FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 22.214.171.124, server: ninja.liveinc.ca, request: "GET /favicon.ico HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "ninja.liveinc.ca", referrer: "https://ninja.liveinc.ca/"
Can you please share you email address so that I can share ssh creds of my server with you??
Looks like something’s wrong with Nginx. Can you try this solution? https://serverfault.com/a/517327
If using Docker, should the PHP FPM sock file be in the InvoiceNinja container or the NGINX container? I don’t see it in either. Thanks for the help!
EDIT: I had to use 127.0.0.1:9000 instead. Still getting the
FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream error though.