I need to change the permissions of the project folders
buman-copilot
PROOP
a year ago
I deployed a PHP application with Laravel, and I need to change the permissions of some project folders to upload some files through the application.
Here are the commands I need to run on the server:
chmod -R 775 storage
chmod -R 775 bootstrap/cache
chmod -R 775 public/uploads
Without running them, I cannot upload any files to the application.
This is an urgent request, I need to resolve it as soon as possible as the operation of my company depends on this adjustment.
Attempts to solve the problem that were unsuccessful:
1. Add the environment variable "RAILWAY_RUN_UID=0"
2. Execute a .sh script containing the commands mentioned through package.json
Ex:
"scripts": {
"lint": "eslint ./resources/views/page",
"dev": "vite",
"build": "vite build && sh startup.sh",
"clean": "vite clean",
"watch": "gulp watch"
},
The content of startup script:
---------------------------------
#!/bin/bash
# Alterando as permissões das pastas
chmod -R 775 storage
chmod -R 775 bootstrap/cache
chmod -R 775 public/uploads
echo “Permissões atualizadas com sucesso!”
---------------------------------------------
The .sh script was indeed executed and I received the success log, but permission was still not granted to the directories.
Log: #15 7.557 “Permissões atualizadas com sucesso!”
-----------------------------------------------
I am using the default deploy with nickspacks, how can i solve this without using a Dockerfile?
3 Replies
a year ago
You will need to use a Dockerfile to modify the permissions structure of the image unfortunately.
Status changed to Awaiting User Response Railway • over 1 year ago
buman-copilot
PROOP
a year ago
I used a nixpacks environment variable to replace the build command and add the chmod commands, but they had no effect. I thought they would workStatus changed to Awaiting Railway Response Railway • over 1 year ago
a year ago
Yea, if you need to chmod you can't do that via the Nixpacks system. You will need to make your own Dockerfile.
Marking as resolved.
Status changed to Awaiting User Response Railway • over 1 year ago
Status changed to Solved brody • over 1 year ago