Laravel 6.18.2: The Process class relies on proc_open, which is not available on your PHP installation
Get the solution ↓↓↓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 isea-php73
. I also triedea-php71
andea-php72
.
Inapp/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 IClear Cache
, again it gives the proc_open error for one time and then call the schedule funtion every minute.
Answer
Solution:
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 uponproc_open
. If this still doesn't work, try disabling debug mode.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: call to a member function format() on string
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.