suto

Member
Feb 17, 2021
6
0
1
Hollandia
cPanel Access Level
Root Administrator
i've made a websocket application with Laravel it works locally, but when i try running it on cPanel it tells me that the websocket driver has no connection.
how can i make this work or what are the possible solutions?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
6,810
895
313
cPanel Access Level
Root Administrator
Hey there! We don't provide any type of official support for Laravel, but we have an installation guide here you might find helpful:


Can you work through that and see if that helps?
 

suto

Member
Feb 17, 2021
6
0
1
Hollandia
cPanel Access Level
Root Administrator
Hey there! We don't provide any type of official support for Laravel, but we have an installation guide here you might find helpful:


Can you work through that and see if that helps?
my issue is that i have Laravel working, but my application uses a websocket, which tries to use a port, but within cPanel it tells me there's no connection even if i navigate to the folder with the terminal and run the command for it.
more info on websocket: Introducing laravel-websockets, an easy to use WebSocket server implemented in PHP | freek.dev


i did saw one video with Daemons to open a port for it and run a 24/7 command, but what are my options?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
6,810
895
313
cPanel Access Level
Root Administrator
Thanks for the additional details.

The first thing I would check would be the port itself to see if the service is listening. You can do that with the following command, and this example uses port 80 for the webserver:

Code:
netstat -lpn | grep 80
You would just need to change 80 to whatever port you are expecting this to be listening on. If nothing shows up there, you'll want to ensure the service is running correctly on that port.

Once that is working you'll need to make sure the port is open in the server's firewall.
 

suto

Member
Feb 17, 2021
6
0
1
Hollandia
cPanel Access Level
Root Administrator
netstat -lpn | grep 80

That command doesn't seem to work on the cPanel terminal, but the command to start the websocket does except it shows no incoming connections compared to local testing when going to the address and just gives me the same error as before (which is due the service not actually being online, tested this locally by not having the service on)
php artisan websockets:serve
 

suto

Member
Feb 17, 2021
6
0
1
Hollandia
cPanel Access Level
Root Administrator
Ah, so the root user needs to do something with the established port in the application?
what does the root user need to do? open the said port or run php artisan websockets:serve command somewhere to have it run 24/7 for that application?
or something else, because i can imagine if i tell them my current info they might not even know what to do.