Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions docs/book/v1/installation/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ If running your project you encounter some permission issues, follow the below s

> PHP Fatal error: Uncaught InvalidArgumentException: The directory "/var/www/_example.local_/html/data/cache" is not writable...

**Fix:**
**Fix:** give the web-server user write access through the group, rather than opening the folder to everyone.

```shell
chmod -R 777 data
sudo chown -R "$USER":www-data data
sudo chmod -R 775 data
```

### Error
Expand All @@ -23,5 +24,11 @@ chmod -R 777 data
**Fix:**

```shell
chmod -R 777 log
sudo chown -R "$USER":www-data log
sudo chmod -R 775 log
```

> Replace `www-data` with the user your web server runs as if it differs — it is `apache` on AlmaLinux and RHEL derivatives, and `nginx` where nginx runs the worker processes.

> `chmod -R 777` is sometimes suggested for these folders.
> Avoid it outside a throwaway local VM: it lets anything on the machine rewrite the Twig and config caches, and those are executable PHP.
16 changes: 7 additions & 9 deletions docs/book/v1/installation/running-the-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@ We recommend running the application on **AlmaLinux 10**, using **WSL 2**:
- install [AlmaLinux 10](https://docs.dotkernel.org/development/v2/setup/installation/)
- install the application in a virtualhost as recommended by the chosen distro
- set `$baseUrl` in **config/autoload/local.php** to the address of the virtualhost
- set the permissions for the `data` folder
- give the web server write access to the `data` and `log` folders

```shell
chmod -R 777 ./data
```

- set the permissions for the log folder

```shell
chmod -R 777 ./log
sudo chown -R "$USER":www-data data log
sudo chmod -R 775 data log
```

- run the application by opening the virtualhost address in your browser
Expand All @@ -26,7 +21,10 @@ You should see the `Dotkernel Light` welcome page.
> If you are getting exceptions or errors regarding some missing services, try running the following command:

```shell
sudo php ./bin/clear-config-cache.php
composer clear-config-cache
```

Do not run this with `sudo`.
Doing so leaves the regenerated `data/cache/config-cache.php` owned by root, which the application can no longer rewrite — the permission errors the [FAQ](faq.md) exists to fix.

> If `data/cache/config-cache.php` is present, that config will be loaded regardless of the `ConfigAggregator::ENABLE_CACHE` configuration in `config/autoload/mezzio.global.php`