how can run websockets:serve on hosting laravel - php

Work on a laravel site with real-time notifications using the laravel-websocket library from:
https://beyondco.de/docs/laravel-websockets/getting-started/introduction
On the local server I have to run the following command for it to work:
php artisan websockets:serve
Starting the WebSocket server on port 6001...
Now I have uploaded the website to cloudways hosting
How can I implement the command to always run the server?
php artisan websockets:serve

If you are using VPS, I think you should install a supervisor to help out running your WebSocket. Here example that I found click

Related

I want to run artisan commands on my online sever

Hello guys i have finished developing my website the next question is can i run then Artisan Commands on the web server like go daddy? just like PHP artisan up
Just contact support to enable SSH Access and you will be able to run artisan commands through your terminal.
After your SSH access is enabled, you can use Putty or run the ssh command in your linux terminal to connect with the server:
ssh username#hostname:port
Some useful links:
How To Use SSH To Connect To A Remote Server In Linux Or Windows
Beginner’s Guide To Setting Up SSH On Linux And Testing Your Setup
Connecting via SSH to your server
Hope it helps.
just connect
ssh username#hostname:port
then type
php /path/to/project/ artisan ...

Symfony fresh installation is not working on my localhost

I installed a fresh copy of Symfony on my localhost at htdocs\symfony-fresh and the file structure is:
Now I run the following in git bash:
$ php bin/console server:run
then I was suggested to browse at 127.0.0.1:8000 to see the fresh installation of symfony. It works like a charm. But one day later I browse at 127.0.0.1:8000 and I can see the following error message:
This site can’t be reached
127.0.0.1 refused to connect.
It seems server is offline. I checked my apache & Mysql is running.
Then I tried to run the command again:
$ php bin/console server:run
But same problem is going on. I am new in Symfony and enjoying to learn, but this problem stuck me. What should I do to run this app browsing at 127.0.0.1/symfony-fresh or localhost/symfony-fresh?
You should check status follow:
php bin/console server:status
By default, the web server listens on port 8000 on the loopback device. You can change the socket passing an IP address and a port as a command-line argument:
# passing a specific IP and port
php bin/console server:start 192.168.0.1:8080
# or like this
php bin/console server:start *:8080
Apache has nothing to do with this, the built in Symfony server is based on php built in server (php -S ...)
The built in server is intended for development use only, you must run the command every time the server has stopped or the machine has rebooted.
If you want to use Symfony with apache you can setup a virtualhost: https://symfony.com/doc/current/setup/web_server_configuration.html

laravel 5.4 php artisan serve Invalid request (Unexpected EOF)

I am using windows 10 and wamp server and I am fresh installing laravel and all i get is this error message and is it necessary to do php artisan serve everytime i open laravel ? as long as i close cmd prompt localhost:8000 refused to connect .
Php artisan serve error
I think you are running a Laravel project blog by command php artisan serve and you are browsing your application by localhost:8000 or 127.0.0.1:8000
Your screenshot saying that when you are trying to visit a url which is not defined in your routes/web.php then, you are getting invalid request (Unexpected EOF) error in your cmd.
And of course! in this case when you close cmd then your Laravel app will not run.
So now, if you don't want to run your Laravel app by the following command each time, then you can use Laragon in windows environment.
Either you have to run php aritsan serve or set up a virtual host in your OS. Here is how to set up a virtual host in Ubuntu 16.04: How To Set Up Apache Virtual Hosts on Ubuntu 16.04
This is case, you can keep your cmd open. And open another cmd, redirect to file path where you are working and it should work fine.

Can't run Artisan::call('migrate')

I have a problem with Laravel 5.3 on Apache server hosted on CentOS, VPS.
When I try to call Artisan::call('migrate'), I'm get in die dump 0 and application not fire migrate. I was try that on vagrant and wamp in local and everything work fine and artisan command fires.
What I have to check on server, what package or module?
I was found the solution using external api route. I was do that on server and I can't run that command from main

php artisan serve - how do I get mysql to run

I'm new to all this artisan stuff. When I start my php server with
$ php artisan serve
How do I get the mysql server to run?
The MySQL server is independent of Laravel. The artisan command is just an interface to Laravel which runs PHP scripts in the background.
To start your MySQL server on Linux, you will have to run something like
sudo service mysql start
For Windows, you will get access to the server via WAMP or from the installed services.
actually if you want to modify a little bit of laravel framework , you can do it like this:
open ServeCommand.php file on /vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php
then locate to serverCommand() function
add this command
echo shell_exec('sh your_terminal_command_to_start_mysql ');
everytime you run php artisan serve it will also execute your mysql service start command
For Windows or Mac, you will need XAMPP installed to initiate MySQL. https://www.apachefriends.org

Categories