Laravel WebSockets can be installed on cPanel accounts with a few commands.
Note: The following commands are meant to be run as the cPanel user and not root. Information on connecting to SSH as the cPanel user can be found here:
2. Navigate to the Laravel project in which WebSockets are to be installed on:
# cd example-app/
3. Install the WebSockets with the following commands:
[~/example-app]# php artisan migrate
[~/example-app]# php artisan vendor:publish --provider="BeyondCode\LaravelWebSockets\WebSocketsServiceProvider" --tag="config"
4. The WebSocket can now be started with the following command:
[~/example-app]# php artisan websockets:serve
Starting the WebSocket server on port 6001...
If you receive the following error when running the migrate command, ensure that the .env file is modified with the correct MySQL information.
SQLSTATE[HY000]  Access denied for user 'root'@'localhost' (using password: NO)