R
Railway•7mo ago
QZ

Railway puts my php application in /app

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