how run laravel php artisan websocket:init command on online server? - laravel

i run websocket on localhost in laravel with this command:
php artisan websocket:init
and It works properly.
but i use cpanel in online server. and i dont access to terminal. how run websocket on online server?

You dont, you need to have ssh access to the server to run the command. You can try schedule to run the command but I'm almost 99% sure that won't work. I talked with my hosting company if I could run a simple cache clear and they said I had to pay for ssh access.

Related

If I run it on laravel localhost, it shows me only file, how to fix it

If I run laravel on localhost, it shows me only file, how to fix this
The main index.php file is in Laravel's public/ directory. If you visit http://localhost/Employee/public, you'll likely see your Laravel site.
If you point your webserver's DocumentRoot at that directory, you'll be able to visit the app at http://localhost/. If you want to run multiple apps locally, you'll want to start playing with virtualhosts.
Alternatively, consider using Laravel's Valet, Sail, or Homestead options for local development; each will handle this sort of thing for you. Sail is Laravel's current recommendation.
You can use a web server such as Apache or Nginx to serve your laravel applications. If you have PHP 5.4+ and would like to use PHP's built in development server you may use the serve artisan command:
cd /project_directory
php artisan serve
By Default it will run application on port 8000
If you want to change to other port specify port number like
php artisan serve --port=8080
It will run your application on the PHP development server on localhost:8080
Docs: https://laravel.com/docs/4.2/quick#local-development-environment

How can i enable artisan commands in cpanel?

as you probably knew when we connect to C Panel and host by remote in php storm ...
we are not able to use from php artisan commands
how can i enable it? in really host?

Why is command php artisan serve not working anymore?

I am new to laravel development and have been migrating my web app to laravel for the past two weeks but suddenly my local server has stopped responding.
localhost:8000 does not load any page, previously it loaded my app's home page. Now, it looks like it is in an infinite request loop or something as indicated by the circle on the top of the tab.
I've tried the following solutions but still no luck:
php -S localhost:8000 -t public/
as referred here Why command "php artisan serve" not working
I have also tried other ports but I cannot successfully make a request to the server on those ports either
php artisan serve --port=8888
I have also run the code below to see which ports are active and kill those ports with the command below but starting the server after that still does not respond.
ps -ef | grep php
sudo kill some number
I think my issue is something deeper than switching the ports up because regardless of the port, I still do not get a server response.
However, if I whip up MAMP I do get a response from that server, if that helps.
Any thoughts?
If you had infinite request loop try another port like this:
php artisan serve --port: 8090

Laravel-Php artisan serve url (127.0.0.1:8000) vs localhost/laravelproject/public

I want to access my laravel project.I run php artisan serve and access the 127.0.0.1:8000 in browser.
But i learned that I can also check my project using the localhost/laravelproject/public url whithout running php artisan serve.
Question: What is the point of using php artisan serve?
No point in two different methods like you mentioned run laravel by "php artisan serve" and by "project url" followed by localhost. But advantage of "php artisan serve" is you can run you laravel project without putting in htdocs/www directory i.e servers root directory. You can put laravel project anywhere where you want and run through the artisan command.
I found some information you may find interesting:
https://www.quora.com/How-can-I-use-php-artisan-serve
But in simple words, php artisan serve is an easy way to create a php server and that is what laravel needs to run.
You could do the same with "php -S 8080 (which would start a php web server (single threaded) in the current directory on port 8080)"
Also if you have already a php server running with apache or nginx it would not be necessary any of the commands.
Hope you find this helpful.
The `Serve command is just a shortcut for the PHP Builtin Webserver, something PHP has out of the box, so the point of using it is to start testing your application as fast as you could, you just need to install PHP, Composer and your application is up (if you don't need anything else, of course). But if you already have Nginx installed, there is no point at all, just use it.
It's not wise to use the Builtin Webserver in production.

Api auth middleware is not working on serve but working in local

Api auth middleware is not working on serve
I have an exactly same problem. Please help me.
Did you run php artisan passport:install on server? Do you have valid oauth keys in storage folder on server??
if not then run the command on server by using ssh or any other accessible server terminal:
php artisan passport:install

Resources