我正在使用pm2来使用后台进程,我只是遇到了一些问题,我的系统需要两个后台进程,但是在不同的artisan命令中,所以我使用下面的步骤: # install
npm install -g pm2
# in project dir with your CI or dev setup tool
# --name gives task a name so that you can later manage it
# -- delimits arguments that get passed to the script
pm2 start artisan --interpreter php --
我创建了一个laravel任务并添加到我的crontab文件中
app/Console/Kernel.php
<?php
namespace App\Console;
use Carbon;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your app
我们正在尝试用pm2 0.12.8启动我们的应用程序,在ubuntu14.04上使用octa核心处理器。git集线器上的read me有一个非常直接的命令,用于在集群模式下运行节点应用程序。
#集群模式
$ pm2 start app.js -i 0 **# Will start maximum processes with LB depending on available CPUs**
$ pm2 start app.js -i max **# Same as above, but deprecated yet.**
但上面的命令并不适用于我们。当我们尝试运行这些命
我能够以编程方式注册事件,Illuminate\Support\Facades\Event及其侦听器方法。我想以类似的方式动态注册命令。在拉拉维尔有办法吗?或者,除了在app/Console/Kernel.php中注册它之外,在Laravel中做什么最好的方法呢?
更新我可以通过下面的代码注册一个类。
use Illuminate\Console\Application as Artisan;
if (app()->runningInConsole()) {
Artisan::starting(function ($artisan) use ($commandClass) {
我刚刚从第三方服务器复制了一个Laravel站点到我自己的服务器上(通过克隆repo),一切正常,除非每次邮件队列运行时,它都会收到以下消息:
Swift_TransportException: Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted.
Learn more at
535 5.7.8 https://support.google.com/mail/?p=BadCredentials b35sm55