Laravel,linux,xshell executes the crontab scheduled task, and the scheduled task log executes normally, but the log write in laravel is not performed.

the environmental background of the problems and what methods you have tried

in laravel framework, linux environment, xshell executes crontab scheduled tasks,

they said that the root directory of the executed project is the absolute path, which I have tested as the absolute path, but I don"t know why it hasn"t been executed.

related codes

/ / Please paste the code text below (do not replace the code with pictures)

namespace AppConsole;
use AppHttpControllersLogController;
use Log;
use IlluminateConsoleSchedulingSchedule;
use IlluminateFoundationConsoleKernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{

/**
 * The Artisan commands provided by your application.
 *
 * @var array
 */
protected $commands = [
    \App\Console\Commands\MsgTask::class
];

/**
 * Define the application"s command schedule.
 *
 * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
 * @return void
 */
protected function schedule(Schedule $schedule)
{
    $schedule->command("msg:send")->everyMinute();

   /* $schedule->call(function () {
                new LogController( 4 , "" );
            })->everyMinute();*/
}

/**
 * Register the commands for the application.
 *
 * @return void
 */
protected function commands()
{
    $this->load(__DIR__."/Commands");

    require base_path("routes/console.php");
}

}

namespace AppConsoleCommands;
use IlluminateSupportFacadesApp;
use IlluminateConsoleCommand;
use Log;
use AppHttpControllersLogController;
class MsgTask extends Command
{

/**
 * The name and signature of the console command.
 *
 * @var string
 */
protected $signature = "msg:send";

/**
 * The console command description.
 *
 * @var string
 */
protected $description = "Msg send";

/**
 * Create a new command instance.
 *
 * @return void
 */
public function __construct()
{
    parent::__construct();
}

/**
 * Execute the console command.
 *
 * @return mixed
 */
public function handle()
{
    Log::info("test");
    //new LogController( 4 , "" );

}

}

commands in crontab:

    • / usr/bin/php / www/wwwroot/default/test/artisan schedule:run > > / dev/null 2 > & 1

what result do you expect? What is the error message actually seen?

May.15,2022

locate the problem first, whether it's a linux system problem, a crontab problem, or a framework problem.


solved, the problem of php path and the configuration of php.ini

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36825-2c011.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36825-2c011.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?