# Post deployment commands

**Project:** Servers | **Board:** Live | **Votes:** 7
**URL:** https://roadmap.ploi.io/projects/1-server-level-requests/items/446-post-deployment-commands

---

When using zero-downtime deployments a lot of issues can arise.

If using Horizon, if you terminate it in the deploy script it happens before the new code is live missing changes.

restarting PHP-FPM happens before the site goes live

These are two examples of things that should happen AFTER zero downtime has been completed.

So I suggest a "Post deploy" like the current deployment, but it runs after the deployment has finished.

Zero downtime is currently not useable without it (unless we manually restart things after each deployment)

---

## Comments

**René Sinnbeck** (2023-06-29T05:12:12+00:00):
Could this perhaps be pointed out in the docs? I am sure a lot of people does not know this and it can lead to some bad problems as Samuel said (I have run into these myself before I knew I had to reload php-fpm manually)

**René Sinnbeck** (2023-12-07T14:22:24+00:00):
Any updates on this? Personally I feel this is quite a big problem that can lead to a lot of problems if people arent aware or forget to restart fpm after a deployment.

**Samuel Loft** (2023-12-13T11:23:28+00:00):
I have given up hope, zero downtime is disabled on most of our projects now as it is unusable in it's current state.

**René Sinnbeck** (2024-09-09T07:59:11+00:00):
This now all seems to be working for new sites. I don't even need to restart fpm anymore. 

The nginx config has been changed


```
//before
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

//after
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
```
I am currently going over old sites, and making this change

**Dennis** (2025-04-15T06:16:43+00:00):
So basically pre, main and post deploy scripts have been added for a while now. Basically this should solve the problems you're experiencing.

Also note that reloading FPM isn't needed in these deploy scripts.

