Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

laracoft's avatar
Level 27

Missing /var/run/php-fpm.sock after reboot

  1. I'm on ubuntu 22.04
  2. On A, I have scripted my server installation to install PHP (8.4.21), MySQL and Apache
  3. On B, I have scripted my server installation to install PHP (8.4.21), MySQL and Nginx
  4. 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
  5. The script of A remains problem free
  6. Has anyone faced the same issue and found a solution? I suspect it is in Nginx
0 likes
8 replies
JussiMannisto's avatar

Start the php-fpm service:

sudo systemctl start php-fpm

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.

laracoft's avatar
Level 27

There is no such service as php-fpm, this problem started after 17th Apr 2026... probably in May 2026.

JussiMannisto's avatar

If you had this file before the reboot:

/var/run/php-fpm.sock

Then you definitely had php-fpm running earlier.

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.

laracoft's avatar
Level 27

You keep telling me how things should be, sure, but I already know that

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?

DigitalArtisan's avatar

Have you tried php8.4-fpm to match your php version?

If that service does not exist, you need to install it.

JussiMannisto's avatar

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.

laracoft's avatar

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.

JussiMannisto's avatar

Do tell, what is it that I clearly don't know?

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.

Please or to participate in this conversation.