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
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):
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.on cPanel goto multiPhPINI and enableing (allow_url_fopen)
this may fix problem