Volume
Hi I recently suscribe to a hobby plan and I'would like to have a page for uploading images using volumes. How can I configure volumen because it seems that I don't have permissions
55 Replies
Project ID:
08568194-e50d-414f-80c8-71ca1b547dc2
08568194-e50d-414f-80c8-71ca1b547dc2
please show any errors you are getting
I use this code tu upload with a simple form in php
The output was " permission denied"
show me the code that saves the file to the volume?
And other case was that using "mkdir" had the same output
Ok
try mounting the volume to
/app/imagenes
then storing the files into imagenes
(note the lack of a forward slash)
and dont do any mkdirThe output was "failed to open stream: permission denied"
youve tried what i suggested?
Ok ok i will try it
ah okay sounds good
the output was this, and the volume/code is this
I'll have to call in the big guns
hahahah okok
@Vin please grace us with your immense knowledge
LET'S
Lemme read
Instead of specifying a path, mount your volume where you want it to be and use the environment variable
RAILWAY_VOLUME_MOUNT_PATH
where you would reference the location in your codeokok
same situation failed to open stream permission denied
RAILWAY_VOLUME_MOUNT_PATH
is set automatically for you, you dont need to set it yourself
are you deploying with nixpacks or a dockerfile?ok i will delete it, nixpacks
@aleks please help
done
i know
php has so many issues with permissions
hahahha its complicated
pretty sure its not your fault at this point
in other hosting (free) miarroba.com same code it works
It really does.
yeah its not an issue with your code
Can you summarize your issue @Ratix ? It's hard to tell from the logs
I think it's the same permissions error folks were running into before, which is that volumes weren't mounted with the right permissions for the
nginx
user (which PHP apps run under) to edit themaleks please please just run php apps as root like how ever other nixpacks provider runs their code
i wanna upload images to the volume "imagenes" but "failed to open stream: permission denied"
using a simple form then "move_uploaded_file"
i refuse on moral grounds
then how can this be solved now?
@Ratix, are you able to share your repo? If you are, I can try and do some testing to see if I can get a solution for you that works
vin, what about mounting to
/app/storage/images
?
you've had success with php and a mount point inside of /app/storage
before right?Yeah, I did. The only way I got it working with PHP was placing the mount path inside of
/app/
but the environment variable should work as well, so, if they can share their repo, I can do some deeper testing and hopefully get a solutionok this is the repo https://github.com/iAmRatix/rooms
GitHub
GitHub - iAmRatix/rooms
Contribute to iAmRatix/rooms development by creating an account on GitHub.
only the part for uploading images
Okay, thanks. I’ll give it a look in a little while and see what I can come up with for you
thanks a lot
dont worry
hi good
@Vin ^
what's up @Adam can u help me? hahaha
im done
it's been 84 years
No, I'm just here to ping in Vin for visibility since he said he'd look into it
damn in 84 years you could have learnt how to write a dockerfile
thx
u 2 hahaa xd
I already know how to write a dockerfile
for the languages that I know
😦
Sorry, I’ve been away from my computer all day. Went to the renaissance festival. I’ll check on that code tonight. My bad @Ratix
Hey @Ratix sorry about the delay... I just tested the code that you sent me... The attached screencast shows that it is working properly. From a fresh deploy with your code exactly how you sent it to me, no changes at all. I hope the screencast helps. If not, feel free to tag me in this thread and I'll be more than happy to do some further testing for you.
I forgot to attach a screenshot of the actual PHP service environment variables.
it works thanks
/app/storage was the correct mount path