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 ...
Related
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
Trying to execute aws cli commands with php shell_exec on local server (for tests).
I'm using xampp,
windows operating system,
Laravel and php,
I installed aws cli on windows.
Windows cmd recognizes the aws commands, but when I try to execute the aws command with shell_exec i get an error: "aws is not recognized as an internal or external command".
Tried this simple script:
$exec = shell_exec('aws --version');
$exec return null.
Appreciate any help.
if you can't run the command directly in shell_exec(), then what you can do is make a batch file with the command and place it on the root of your website. Then, just run:
<?php echo exec("script.bat"); ?>
also, make sure to put any environment variables needed and recommend to use full path for the aws executable
I solved it. It was pretty simple. It doesn't enough to restart xampp. I also had to quit xampp and re enter
I face this error only when "php artisan serve" command is not running. If this command is running then there is no such a error, but as i closed command prompt this error occurs. i have also changed port but no vain.
Kindly help me.I would like to mention here that I'm using Window 10 OS.
Thanks in advance.
If you don't have a HTTP server (like WAMP or similar installed), you'll need to keep the Command Prompt / Terminal window running at all times. Closing the window or stopping the php artisan server command will terminate the server that's running the website.
If you want a persistent server, you should look into server software like WAMP or XAMPP.
Note that this is expected behavior for the php artisan serve command.
because with this kind of server (like: LARAGON), running 'php artisan serve' is necessary, so if you close the terminal, 'php artisan serve' will automaticaly stop running, then the server will stop too, then you can't reach anymore your localhost.
If you want a persistent server, you should look into server software like WAMP or XAMPP.
Note that this is expected behavior for the
php artisan serve command
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
I've got this PHP site which needs to connect to a Solaris Server to run shell commands (Execute shell script). Im using Apache. How do I connect to the server to run shell commands? Do i need to configure the Apache, & how? Am a newbie in PHP & Apache.
Use exec to execute a command in php. Use ssh to connect a remote server and run shell commands.