unit
unit copied to clipboard
Issue with creating files and folders from PHP
Hello dear developers,
I would like to test Unit for a small PHP project. I use the Docker Image with PHP 8.3 installed.
The code of the application is stored within the container under "/mnt/code/". But I have a, let's call it, data exchange directory. This directory lives outside of my application root.
-/
-- /mnt
-- /code
-/data-store <-- exchange directory
My application need to create new folders and files in that exchange directory.
My config.json looks like this:
{
"listeners": {
"*:80": {
"pass": "routes"
}
},
"routes": [
{
"match": {
"uri": "!/index.php"
},
"action": {
"share": "/mnt/code/",
"fallback": {
"pass": "applications/exchange-data"
}
}
}
],
"applications": {
"exchange-data": {
"type": "php",
"root": "/mnt/code/public/",
"script": "index.php",
}
}
}
But when I try to create a new directory or file in the exchange folder, I receive a permission denied :(
mkdir ('/data-store/data-set/2024-03-01', 0777, true);
mkdir(): Permission denied in /mnt/code/src......
It's the very first time I'm trying to use Unit for one of my applications. I've also tried changing my configuration and adding a user/group - but to no success.
Is there something I have overlooked?