在没有ssh访问权限的情况下运行composer和laravel(artisan)命令 [英] run composer and laravel (artisan) commands without ssh access

查看:87
本文介绍了在没有ssh访问权限的情况下运行composer和laravel(artisan)命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在基本的共享主机上测试一些Laravel应用程序.

当前,我刚刚上传了包括供应商文件在内的完整应用程序,但这花费了相当长的时间.

由于我没有对主机的ssh访问权限,所以我想知道是否可以在没有此选项的情况下运行composer/artisan命令.

我找到了此链接:使用Composer,而无需通过ssh访问服务器(第二个答案),它描述了如何使用 http://phpshell.sourceforge.net/来运行作曲家

但是,我可以在控制台等中更改文件夹.但是我无法运行php命令-我总是会收到内部服务器错误.

解决方案

检查共享的托管提供程序的CP是否具有console功能,该功能允许运行shell命令.也许您可以从那里运行命令.

作为替代方案,您可以纠正自己的工匠赛跑者,然后致电工匠命令从代码中:

Artisan::call('migrate');

要从PHP代码运行composer命令,请使用 shell_exec :

shell_exec('composer update');

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

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.

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

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

解决方案

Check if your shared hosting provider has console feature in their CP which allows to run shell commands. 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:

shell_exec('composer update');

这篇关于在没有ssh访问权限的情况下运行composer和laravel(artisan)命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆