Stuck on the PHP 8.3 FPM Timeout in Zorin OS 18? Here’s the Fix!

PHP Logo

Hey everyone!

If you’ve recently upgraded to Zorin OS 18 (or you're rocking the underlying Ubuntu 24.04 LTS) and tried to get your PHP development environment running, you might have hit a frustrating wall.

You know the one. You go to install or update PHP 8.3, expecting a smooth ride, and suddenly—BAM. The terminal hangs for a solid minute, and then drops a "Service Timeout" error on you.

It looks something like this:

Job for php8.3-fpm.service failed because a timeout was exceeded.

If you checked systemctl status php8.3-fpm.service, you probably saw it failing repeatedly.

Don't panic! Your installation isn't broken, and you didn't mess up your config.

It turns out this is a known quirk with how the new, stricter AppArmor profiles in Ubuntu 24.04 interact with PHP-FPM. Basically, AppArmor is doing its job a little too well and preventing PHP from telling the system, "Hey, I've started successfully!"

The system waits... and waits... and eventually assumes PHP died, so it kills the process.

I’ve got the fix right here. It’s quick, it’s safe, and it’ll get you back to coding in about two minutes. Let’s do this! 🛠️

The Solution: The AppArmor Override

We aren't going to disable AppArmor (security first, right?), but we are going to give PHP permission to speak to systemd.

Step 1: Open Your Terminal

Pop open your terminal (Ctrl+Alt+T). We’re going straight to the source.

Step 2: Edit the Local AppArmor Profile

We need to edit the local override file for PHP-FPM. This is safer than editing the main config file because your changes won't get wiped out the next time you run apt upgrade.

Run this command:

sudo nano /etc/apparmor.d/local/php-fpm

Step 3: Add the Magic Lines

Your file might be empty, or it might have some comments. That's fine. We just need to add the lines that grants write permission to the systemd notification socket.

Paste this into the file:


# Allow systemd notification
@{PROC}/@{pid}/fd/ r,
/run/systemd/notify w,

(Make sure you include that comma at the end! It’s important!)

Save the file by pressing Ctrl+O, Enter, and then exit with Ctrl+X.

Step 4: Reload AppArmor

Now we need to tell AppArmor to pick up our new rule. Run this command to reload the profiles:

sudo apparmor_parser -r /etc/apparmor.d/php-fpm

Note: If that command gives you trouble or you prefer a broader stroke, sudo systemctl reload apparmor works too.

Step 5: Restart PHP-FPM

Now for the moment of truth. Let’s start that service up again.

sudo systemctl restart php8.3-fpm

If the command finishes instantly without hanging... Congratulations! 🎉

Step 6: Verify (Optional but Satisfying)

Just to be sure, check the status:

sudo systemctl status php8.3-fpm

You should see a beautiful green active (running) dot.

Wrapping Up

And that’s it! You’ve successfully bridged the gap between PHP and AppArmor on Zorin OS 18. It’s one of those little "growing pains" of a new OS base, but at least the fix is straightforward. Also, this will work for any other additional PHP versions (like PHP8.4) you may decide to install.

Now you can get back to building amazing things. Happy coding!