skip to Main Content

I used cron job to do some CRUD operation using laravel Task Scheduling. On localhost it is working fine. But on my shared host I keep getting this error.

2020-04-08 16:56:01] local.ERROR: The Process class relies on proc_open, which is not available on your PHP installation. {"exception":"[object] (Symfony\Component\Process\Exception\LogicException(code: 0): The Process class relies on proc_open, which is not available on your PHP installation. at /home/deshiit/public_html/bangladesh-railway-server/vendor/symfony/process/Process.php:143)
[stacktrace] 

But on localhost it works fine. I contacted my hosting company to remove proc_open form disable PHP functions, but they can’t. I tried the solution given here. But this solution is not working.

My PHP version is ea-php73. I also tried ea-php71 and ea-php72.

In
app/Console/Kernel.php
if I add
->withoutOverlapping(); after my command,

protected function schedule(Schedule $schedule)
{
    Log::info('Cron Job Started 1.1');
    $schedule->command('outlier:data')
        ->everyMinute()
        ->withoutOverlapping();
}

then proc_open error gives only for one time and then

protected function schedule(Schedule $schedule)

is getting called every minute but it is not executing the handle() funtion

public function handle()
{
    Log::info('Cron Job Started 2.1 in Commands/FindOutlier.php');
}

But if I Clear Cache, again it gives the proc_open error for one time and then call the schedule funtion every minute.

2

Answers


  1. As per the commentd above, make sure Flare does not collect git information (It will try to open the git process and get branch and tag information).

    In flare.php (config/flare.php):

    'collect_git_information' => false 
    'reporting' => [
         'anonymize_ips' => true,
         'collect_git_information' => false,
         'report_queries' => true,
         'maximum_number_of_collected_queries' => 200,
         'report_query_bindings' => true,
         'report_view_data' => true,
    ],
    

    Now, this fixed it on my cPanel instance only after I cleared the config and route caching. Make sure you don’t have anything cached and your OPCache is also cleared.

    From what I see when I look at the code, Flare is the only library that calls upon proc_open. If this still doesn’t work, try disabling debug mode.

    Login or Signup to reply.
  2. on cPanel goto multiPhPINI and enableing (allow_url_fopen)
    this may fix problem

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search