Build PHP 7.3 with Laravel. How can i do it?
I have an old application. How can i make build in service?
P
Percy•15d ago
Project ID:
N/A
TM
Thomas Mendonça•15d ago
N/A
Project ID: N/A
B
Brody•15d ago
You would need to write a Dockerfile to use unsupported php versions
TM
Thomas Mendonça•15d ago
Okay. I need a Dockerfile.
Have a application, but i have questions about how make it.
Can send me?
M
Medim•15d ago
@Thomas Mendonça are you brazilian? if so, do you mind upvoting this community suggestion ? Bora trazer o Railway pro Brasil 😉
Also, I'll send you a dockerfile example
Do you use Composer or Artisan?
TM
Thomas Mendonça•15d ago
Both
Yeah!! I am Brazilian ❤️
I need composer run my Laravel project
M
Medim•15d ago
Ok, one sec
TM
Thomas Mendonça•15d ago
Okay
M
Medim•15d ago
This is my dockerfile using php 7.4 and composer
default.conf
supervisor.conf
this is also an old project, lol
It just doesn't has artisan
TM
Thomas Mendonça•15d ago
Okay
I will try here
Need I to config something in Railway settings?
B
Brody•15d ago
you shouldn't have to
TM
Thomas Mendonça•15d ago
okay
TM
Thomas Mendonça•15d ago
TM
Thomas Mendonça•15d ago
Error 😢
B
Brody•15d ago
full build logs please - https://bookmarklets.up.railway.app/log-downloader/
TM
Thomas Mendonça•15d ago
M
Medim•15d ago
change
php:7.4-fpm
to php:7.3-fpm
There's some incompatibilities between the two
TM
Thomas Mendonça•15d ago
Okay, one sec
TM
Thomas Mendonça•15d ago
error
B
Brody•15d ago
build logs again please
TM
Thomas Mendonça•15d ago
TM
Thomas Mendonça•15d ago
There is, my bro
B
Brody•15d ago
im not the php guy, you will have to wait for a response from medim, please be patient as this is community support
M
Medim•15d ago
replace it to
php:7.3-fpm-alpine
i'm wondering if docker-ext exists in php:7.3-fpm
by default 🤔
im sure the alpine one does thoTM
Thomas Mendonça•15d ago
okay, one sec
haha no problem, I will wait.
thanks for you help
TM
Thomas Mendonça•15d ago
TM
Thomas Mendonça•15d ago
hehe fail again
:"(
B
Brody•15d ago
going forward, please only send the logs you get from the bookmarklet, the screenshots are not very helpful
M
Medim•15d ago
alpine doesn't has apt-get lmao
wait a sec
TM
Thomas Mendonça•15d ago
Ow, okay.
M
Medim•15d ago
one sec, i'm redoing the dockerfile to be alpine based
let's see the next error lmao
(it prob won't gonna find one of those packages since i migrated debian to alpine-linux)
TM
Thomas Mendonça•15d ago
ok
one minute
TM
Thomas Mendonça•15d ago
TM
Thomas Mendonça•15d ago
M
Medim•15d ago
💀
what is weird is that it runs the docker-php-ext in line 21 but no the one that configures gd
you can try removing that line entirely if your app doesn't rely on gd
or try changing it to
TM
Thomas Mendonça•15d ago
okay
what's gd?
M
Medim•15d ago
Image manipulation
TM
Thomas Mendonça•15d ago
Ah okay
one sec
TM
Thomas Mendonça•15d ago
M
Medim•15d ago
whitespaces?
B
Brody•15d ago
^
M
Medim•15d ago
tbh just remove that entire line
if its needed we'll find a way to add it
lets get that app up first
TM
Thomas Mendonça•15d ago
Okay
M
Medim•15d ago
TM
Thomas Mendonça•15d ago
M
Medim•15d ago
almost there, lol
TM
Thomas Mendonça•15d ago
hehe
yeah
more one
M
Medim•15d ago
it installs from source, we need git
TM
Thomas Mendonça•15d ago
RUN apk update && apk add --no-cache again?
twice?
M
Medim•15d ago
edited it, forgot to remove that line
TM
Thomas Mendonça•15d ago
ah
okay
M
Medim•15d ago
also, do you got the
default.conf
and supervisord.conf
at the same dir level as your dockerfile?TM
Thomas Mendonça•15d ago
yes, i do
building...
TM
Thomas Mendonça•15d ago
M
Medim•15d ago
yeah it needs gd
lmao
TM
Thomas Mendonça•15d ago
Oh God
And now?
M
Medim•15d ago
re added GD with some php 7.2 args
this help thread made my remember my hate for php in prod
also, good thing railway doesn't charge build time
TM
Thomas Mendonça•15d ago
Yeah hehe
So good
TM
Thomas Mendonça•15d ago
TM
Thomas Mendonça•15d ago
error
M
Medim•15d ago
you are using a github repo as package in composer
M
Medim•15d ago
M
Medim•15d ago
hmm..
TM
Thomas Mendonça•15d ago
okay
i will remove
one minute
M
Medim•15d ago
is it needed?
seems like its a private repo
and its a hassle since you would need to generate SSH keys just to clone them with composer but its a bad idea to upload your SSH keys to your repo so you would need repo secrets... so lets avoid all that
TM
Thomas Mendonça•15d ago
i will remove, it is trash
M
Medim•15d ago
..did it build?
TM
Thomas Mendonça•15d ago
build complete
but don't show the default page
M
Medim•15d ago
prob some nginx config
TM
Thomas Mendonça•15d ago
I how put "/public"?
to publish
M
Medim•15d ago
@Brody I set a 8080 port in my server.listen so I guess he would need to add a PORT=8080 env var?
.
@Thomas Mendonça create a PORT=8080 env var
TM
Thomas Mendonça•15d ago
Oooh
this is the problem
!!
M
Medim•15d ago
we may need to mess a bit with the default.conf now, since I use that specific config to fastcgi
TM
Thomas Mendonça•15d ago
one minute
i will set port
ah fail
TM
Thomas Mendonça•15d ago
TM
Thomas Mendonça•15d ago
M
Medim•15d ago
no errors
just wait
try refreshing it
TM
Thomas Mendonça•15d ago
i do it
M
Medim•15d ago
:thonking:
can you send the url here?
B
Brody•15d ago
Thomas, where did you set the env var
M
Medim•15d ago
(I also think there's some issues with the default.conf)
TM
Thomas Mendonça•15d ago
B
Brody•15d ago
would you mind answering this question
can you please answer the question
M
Medim•15d ago
Did u set it in the Railway Env tab or locally?
TM
Thomas Mendonça•15d ago
in the railway system variables
M
Medim•15d ago
TM
Thomas Mendonça•15d ago
Railway env tab
Railway env tab
M
Medim•15d ago
@Brody would it be too hard to migrate from nginx to caddy?
B
Brody•15d ago
if you where familiar with the technologies involved, no
M
Medim•15d ago
try this default.conf
laravel serves in the /public folder
saw you mentioning it, I forgot about that
TM
Thomas Mendonça•15d ago
Okay
Building...
One minute
nothing yet
"fastcgi_pass 127.0.0.1:9000;"
Is it right?
M
Medim•15d ago
Anything in the logs?
TM
Thomas Mendonça•15d ago
M
Medim•15d ago
yes.
I'm out of ideas :PepeCRY:
we got it to build and deploy but I suck at nginx
TM
Thomas Mendonça•15d ago
Ahh :/
So close
M
Medim•15d ago
https://laravel.com/docs/11.x/deployment#nginx
we can try the default conf from laravel docs
TM
Thomas Mendonça•15d ago
okay
One minute
TM
Thomas Mendonça•15d ago
M
Medim•15d ago
That's normal, just supervisord starting things up
TM
Thomas Mendonça•15d ago
Yeah
But same page
Application failed to respond
https://nepscoin-sistema-production.up.railway.app/
M
Medim•15d ago
:sadcat:
TM
Thomas Mendonça•15d ago
ô sufoco
very difficult
TM
Thomas Mendonça•15d ago
TM
Thomas Mendonça•15d ago
I was set this default.conf
TM
Thomas Mendonça•15d ago
Now is play life
TM
Thomas Mendonça•15d ago
Now is the problem
B
Brody•15d ago
English only please
TM
Thomas Mendonça•15d ago
Sorry
Someone help me?
M
Medim•15d ago
U are now listening to port 80
So that env var u set at railway should also be 80 but if it works I guess u alrady did that
But seems like file serving is still a bit off since it says 404
Is it an API? you can try doing a request to it
TM
Thomas Mendonça•14d ago
Yeah, railway service on port 80
env
Web but not API
I managed to find an error on port 9000, already in use. With this information, can you help me with any solution tips?
M
Medim•14d ago
Its already in use by the fastcgi
oh nvm, u changed it to 80
fastcgi port can't be the same as your listen port afaik, so put like listen on 80 and fastcgi port on a number > 1000
and what did u do to hit that error?
maybe that was the error this entire time, try changing it to like 8080, also you cannot use fastcgi as a unix socket, last time I used it like this on railway it wouldn't work pecause of specific perms.
it needs to be on a port
@Thomas Mendonça
send ur default.conf here for me to edit it
TM
Thomas Mendonça•14d ago
M
Medim•14d ago
just change the listen to
listen 80;
(also change the env var in railway to 80)TM
Thomas Mendonça•14d ago
i'm trying run local
not success
can you analize, please?
M
Medim•14d ago
that default conf won't work locally
that's railway specific
TM
Thomas Mendonça•14d ago
TM
Thomas Mendonça•14d ago
the same problem, if run docker local, run in railway
M
Medim•14d ago
to run locally:
change
server_name
to localhost
to run on railway:
change server_name
to 0.0.0.0
TM
Thomas Mendonça•14d ago
Aah okay
But the nginx, the same is error?
M
Medim•14d ago
404?
TM
Thomas Mendonça•14d ago
yeah
not found the app
M
Medim•14d ago
yeah, I don't know what to do anymore lmao
TM
Thomas Mendonça•14d ago
okay
one minute
i will try
F
Faith•14d ago
Hey idk if this will help at allll BUT i also use laravel on railway and these are my build cmds
its under Custom Build Command
and just put this in
i dont use any form of changes than those cmds, no custom railway conf or anything
TM
Thomas Mendonça•14d ago
Okay
What's PHP version?
@Faith
F
Faith•14d ago
its 8.2, it auto does it
im using nixpacks
TM
Thomas Mendonça•14d ago
Good
Mine 7.3
😢
Knows someone how run PHP 7.3?
F
Faith•14d ago
a guy further up gave a composer with 7.3 try his
TM
Thomas Mendonça•14d ago
im try all
nothing that solved
Guys, I come to you to let you know that it worked!
It was difficult, but I managed to solve it. If you want, I'll put the 3 files here.
I am very grateful to those who helped me and spent time working with me to resolve it. A special hug to @Medim , who was great!
M
Medim•14d ago
Share them here @Thomas Mendonça
So I can see what I missed
TM
Thomas Mendonça•14d ago
Hang out with other likeminded developers & talk about all things https://railway.app on the Railway Community Server.
24KMembers
View on DiscordWant results from more Discord servers?
More PostsTLS certificate has taken over 24 hours for a custom domainI have 2 custom domains - 1 using a subdomain and 1 using the root. The one on the subdomain is workRedis For Vector Search (GenAI)I have Redis database deployed on Railways Pro plan. I want to add LLM Retrieval Augmented GeneratioWhat is the best way to install private npm packages?My usecase is that my node app needs to install a package from a private github registry.
What I wouCron job not running at specific timeHi
I have a cron job that should run every hour 0 * * * *.
For some reason, it skips runs sometimHow much is Railways scalable?Is there any information how much it is scalable in reality?
According to the price, can the serviceCORS Policy problem with backboard.railway.app/graphqlI'm getting a CORS error in my console when using the Railway dashboard.
```
Access to fetch at 'hOutbound ip addressesHi, what are railway's outbound ip addressesBest way to setup back up system for my postgres?Looking to do a backup every X number of hoursRailway <> Hetzner servers cant communicateWe had a deployment running succesfully for the last week
today, the railway instances cant communihow to remove docker cache ?it is always just using cache, and not rebuilding correclyDeployment HelpApologies i have 3 things to deploy and i dont know how to do itCannot Access Railway APIJust noticed that I am unable to access the full public API and the GraphQL Playground isn't workingHow do I create a config file?In the [documentation](<https://docs.railway.app/guides/config-as-code>) for Railway configuration fRedis Connection FailureProject ID: d09cd450-b0ba-483f-ae0c-5e329305f433
Redis is refusing connnections.504 Gateway Timeout issueAll of a sudden my production application starts throwing up 504 error. There are no error logs and Vite React ThreejsI copy nixpacks.toml and Caddyfile from this repository
<https://github.com/brody192/vite-react-temSQLalchemy could not translate host name "postgres.railway.internal"Basically I'm making a engine with env var stored in DATABASE_PRIVATE_URL that references my PostgreHobby plan timeoutRailway returns a 503 Application failed to respond after 30s, it used to be 5 minutes. Can this be time zoneHow to configure the time zone for my project so that it is UTC-5, which is from Lima, or I have alssubscription didn't charged automaticallyHi, I have my card saved on railway and it didn't charged me automatically, should i wait for this o