Execute composer and laravel (artisan) commands without ssh access

I want to test some Laravel applications on my primary shared host.

I am currently just downloading my full application, including the vendor files, however this takes quite some time.

Since I do not have ssh access to my host, I would like to know if it is possible to run composer / artisan commands without this.

I found this link: Use Composer without ssh access to the server (Second answer), which describes how to start the composer using http://phpshell.sourceforge.net/

However, I can change folders in the console, etc. But I can not run php commands - I always get an internal server error.

+5
source share
2 answers

Check if your hosting provider supports console in its CP, which allows you to run shell commands. You may be able to execute commands from there.

Alternatively, you can direct your own artisan runner and call artisan commands from the code :

 Artisan::call('migrate'); 

To run the compiler command from PHP code, use shell_exec :

 shell_exec('composer update'); 
+2
source

To manage a laravel project without ssh access to your server, follow these steps:

  • Compressing a project folder in this way will load quickly and easily.
  • upload compressed files to your server; servers usually provide a file manager for this.
    1. Remove compressed items. Please note that permissions for downloaded files and folders are generally writable to the whole world (777), you need to change folders to 750 and php files to 644, the file manager has an option for this.
    2. Finally, change storage permissions and cache bootstrap to 755 ...

You will be good to go

-1
source

Source: https://habr.com/ru/post/1247865/


All Articles