On A, I have scripted my server installation to install PHP (8.4.21), MySQL and Apache
On B, I have scripted my server installation to install PHP (8.4.21), MySQL and Nginx
For B, when re-running the script on a fresh machine recently, /var/run/php-fpm.sock is now missing and causing the Laravel site not to load in the browser
The script of A remains problem free
Has anyone faced the same issue and found a solution? I suspect it is in Nginx
Then enable it so it starts automatically on boot:
sudo systemctl enable php-fpm
This is assuming the service is named php-fpm in your system, which it probably is if the socket file was named php-fpm.sock before you rebooted. Often the service is versioned instead, e.g. php8.4-fpm.
You need php-fpm to run a Laravel app – or any PHP app for that matter – through Nginx. There are alternatives, but php-fpm is by far the most popular choice.
As I mentioned, the service may have a different name, such as php8.4-fpm. You can look for it:
systemctl list-unit-files | grep php
If you updated PHP and accidentally uninstalled php-fpm, you need to reinstall it.
You keep telling me how things should be, sure, but I already know that
There's no need to get snappy. I'm explaining what you need since you clearly don't know it.
I'm telling you how things are right now, so the big question is have you actually tried to install Nginx vs Apache on 22.04 after my OP?
I've installed both countless times on Ubuntu and other distros. But this has nothing to do with the installation of either. It has to do with php-fpm, or how it's used.
Here's what you need to do:
If php-fpm (or php8.4-fpm) isn't installed, you need to install it.
If it is installed, you need to start it.
If the service is running but the socket file is in another location, e.g. /var/run/php/php8.4-fpm.sock, you need to fix the path in your Nginx config.
The only useful pieces of information you've given so far are:
/var/run/php-fpm.sock no longer exists and your app doesn't work because of that.
There's no php-fpm service.
I can't tell you exactly what is wrong just based on that.
I'm explaining what you need since you clearly don't know it.
Do tell, what is it that I clearly don't know?
The only useful pieces of information you've given so far are: /var/run/php-fpm.sock no longer exists and your app doesn't work because of that.
So why did it disappear when my script has not changed a bit, why was it previously there.. as far as I can recall, there has never been a php-fpm.service, it was always php8.x-fpm.service
I also given a date that this problem started, after 17th Apr 2026, but you don't consider it to be useful.
That php-fpm.sock disappearing means this is an issue related to php-fpm. That should be everything you need to start diagnosing what's wrong if you're familiar with Linux.
Answer these questions to start: do you have php8.4-fpm installed, or have you tried installing it?
So why did it disappear when my script has not changed a bit, why was it previously there
I'm not psychic; I don't know what your script does. What commands does it run? Does it use apt? Are you installing PHP from Ondrej's PPA or Ubuntu archives?
A date on its own is means nothing. Don't get fixated on it and find out what's actually wrong.
Great, finally, you start asking questions instead of dishing out solutions.
/var/run/php/php-fpm.sock does not disappear in the past after reboots.. in fact, it doesn't have much to do with PHP, it is from Debian/Ubuntu's update-alternatives... did you know that?
Yes, php8.4-fpm is installed and /var/run/php/php8.4-fpm.sock exists
Yes, php8.4-fpm is installed and /var/run/php/php8.4-fpm.sock exists
So you have PHP-FPM running but the socket file path is wrong in your Nginx config. Like I wrote 3 days ago:
If the service is running but the socket file is in another location, e.g. /var/run/php/php8.4-fpm.sock, you need to fix the path in your Nginx config.
If you read the post, you could've already fixed the issue.
I'm not going to spell this out any further, I've wasted enough time here.