PHPackages                             ejetar/nginx-fastcgi-fix-permission - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ejetar/nginx-fastcgi-fix-permission

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ejetar/nginx-fastcgi-fix-permission
===================================

A simple way to fix cache folder permissions created by Nginx's FastCGI module.

301PHP

Since Mar 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ejetar/nginx-fastcgi-fix-permission)[ Packagist](https://packagist.org/packages/ejetar/nginx-fastcgi-fix-permission)[ RSS](/packages/ejetar-nginx-fastcgi-fix-permission/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Nginx FastCGI Fix Permission
============================

[](#nginx-fastcgi-fix-permission)

Table of Contents
-----------------

[](#table-of-contents)

- [About](#about)
- [How it works](#how-it-works)
- [Installation](#installation)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [License](#license)

About
-----

[](#about)

This library was born with the objective of fix the permissions of the folder that nginx automatically generates, to store the cache of your site.

In our case, originally the cache folder comes out like this:

```
ls -lsa
4 drwx------  2 nobody root 4096 Mar  4 17:54 cache_folder

```

The problem with this is that if you have a procedure on your site to clear the cache, such as the [Nginx Cache](https://br.wordpress.org/plugins/nginx-cache/) plugin for Wordpress, your user will not will be able to clear the contents of the cache folder.

How it works
------------

[](#how-it-works)

We set up our script to run on a hook called `ExecStartPost` on the Nginx service.

With that, **after** nginx starts or restarts, our script is run, fixing the folder permissions to what we want.

Installation
------------

[](#installation)

1. Open the folder where you want to install the project and run: `composer require ejetar/nginx-fastcgi-fix-permission`
2. Then edit the following file: `/lib/systemd/system/nginx.service`. Add the following line in the `[Service]` section `ExecStartPost=/nginx-fastcgi-fix-permission/fix`.
    Example:

```
[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
ExecReload=/bin/sh -c "/bin/kill -s HUP $(/bin/cat /var/run/nginx.pid)"
ExecStop=/bin/sh -c "/bin/kill -s TERM $(/bin/cat /var/run/nginx.pid)"
ExecStartPost=/opt/nginx-fastcgi-fix-permission/fix

[Install]
WantedBy=multi-user.target

[Service]
LimitNOFILE=65535

```

3. Execute `systemctl daemon-reload`
4. Restart nginx and you're done!

Changelog
---------

[](#changelog)

Nothing for now...

Contributing
------------

[](#contributing)

Contribute to this wonderful project, it will be a pleasure to have you with us. Let's help the free software community. You are invited to incorporate new features, make corrections, report bugs, and any other form of support. Don't forget to star in this repository! 😀

License
-------

[](#license)

This library is a open-source software licensed under the MIT license.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/781358602863d7536e95494388bda4d9f53175fdf5029d9db7b45d4eabef10e9?d=identicon)[ejetar](/maintainers/ejetar)

---

Top Contributors

[![ggirardi1](https://avatars.githubusercontent.com/u/2306117?v=4)](https://github.com/ggirardi1 "ggirardi1 (3 commits)")

### Embed Badge

![Health badge](/badges/ejetar-nginx-fastcgi-fix-permission/health.svg)

```
[![Health](https://phpackages.com/badges/ejetar-nginx-fastcgi-fix-permission/health.svg)](https://phpackages.com/packages/ejetar-nginx-fastcgi-fix-permission)
```

###  Alternatives

[razonyang/yii2-rate-limiter

Yii2 Rate Limiter

1025.0k1](/packages/razonyang-yii2-rate-limiter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
