R
Railway•13mo ago
QZ

Railway puts my php application in /app

WHY DOES RAILWAY PUT MY FILES IN /APP?
24 Replies
Percy
Percy•13mo ago
Project ID: N/A
MantisInABox
MantisInABox•13mo ago
All the containers are assembled that way. Not just PHP applications. It isolates your application from the other system folders that are part of the container.
root
root•13mo ago
👆 What in particular isn't working? I might be able to help; the PHP provider is my Frankenstein monster
QZ
QZOP•13mo ago
I literally have an App folder with my controllers in it so its overriding?
root
root•13mo ago
No Your app folder will be in /app/app
QZ
QZOP•13mo ago
so everything is in app/app bro what?
root
root•13mo ago
Laravel should work with minimal configuration on Railway - just follow the instructions in the deploy logs. No, everything's in /app.
QZ
QZOP•13mo ago
I don't use laravel I build my stuff from scratch using Vanilla PHP Okay So my app is in app
MantisInABox
MantisInABox•13mo ago
Then it should just work, as long as you have an index.php file
root
root•13mo ago
Ah, OK. I assumed, since Laravel uses an /app directory to store stuff
QZ
QZOP•13mo ago
Makes sense you're good
root
root•13mo ago
What does your whole directory structure look like? Where's your index.php?
QZ
QZOP•13mo ago
in /public
root
root•13mo ago
(relative to your project root)
QZ
QZOP•13mo ago
could i maybe override with htaccess?
root
root•13mo ago
Nope, it's easier than that
QZ
QZOP•13mo ago
Set root folder to /public? Already did
root
root•13mo ago
Do you use a router in your index.php, or do you have separate files? no
QZ
QZOP•13mo ago
yes I use my router in there
root
root•13mo ago
Alright Remove your root directory setting, set the NIXPACKS_PHP_ROOT_DIR environment variable to public, and NIXPACKS_PHP_FALLBACK_PATH to /index.php.
QZ
QZOP•13mo ago
Where do i do that and how? Sorry its my first time using railway
root
root•13mo ago
(for future reference: https://nixpacks.com/docs/providers/php) In the "Variables" tab of your service.
QZ
QZOP•13mo ago
Will check
Brody
Brody•13mo ago
QZ, just seen what you've said in #🎤|chit-chat we won't be tolerating that kind of behaviour
Want results from more Discord servers?
Add your server