简体   繁体   English

在没有 ssh 访问权限的情况下运行 composer 和 laravel(工匠)命令

[英]run composer and laravel (artisan) commands without ssh access

I want to test some Laravel applications on my basic shared host.我想在我的基本共享主机上测试一些 Laravel 应用程序。

Currently I just upload my complete application including the vendor files, however this takes quite long.目前我只是上传我的完整应用程序,包括供应商文件,但这需要很长时间。

Since I do not have ssh access to my host I'd like to know whether there's an option to run composer / artisan commands without this.由于我没有对我的主机的ssh访问权限,我想知道是否有一个选项可以在没有这个的情况下运行 composer / artisan 命令。

I found this link: Use Composer without ssh access to server (Second Answer) which describes how to run composer using http://phpshell.sourceforge.net/我找到了这个链接: Use Composer without ssh access to server (Second Answer) 它描述了如何使用http://phpshell.sourceforge.net/运行 composer

However, I can change folders in the console etc. But I cannot run php commands - I always get internal server error.但是,我可以在控制台等中更改文件夹。但我无法运行 php 命令 - 我总是收到内部服务器错误。

Check if your shared hosting provider has console feature in their CP which allows to run shell commands.检查您的共享主机提供商是否在其 CP 中具有允许运行 shell 命令的console功能。 Maybe you'll be able to run commands from there.也许您将能够从那里运行命令。

As alternative, you could right your own artisan runner and call artisan commands from the code :作为替代方案,您可以纠正自己的工匠跑步者并 从代码中调用工匠命令

Artisan::call('migrate');

To run composer command from PHP code, use shell_exec :要从 PHP 代码运行 composer 命令,请使用shell_exec

shell_exec('composer update');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM