Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

marcosdipaolo's avatar

Scheduled commands on shared hosting and proc_open

There's been an issue trying to use task scheduling in a shared hosting, receivng the error:

The Process class relies on proc_open, which is not available on your PHP installation

I read in a laravel's github issue about it. It states that It is because of Flare error reporting service enabled in debug mode, and propose the following workaround:

Publish flare config file

php artisan vendor:publish --tag=flare-config and in config/flare.php

Set '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,
    ],

It looks like it worked for a lotta people, but not for me. Then there was someone adding to clear cache, or clearing Bootstrap folder, or memory issues or other things triggering a proc_open error.

My question is if task scheduling in Laravel needs proc_open or it can be sorted out in some other way if you are in a shared hosting (hosting companies will always refuse to change that setting in a shared hosting)

0 likes
5 replies
jlrdw's avatar

I've seen this come up before. I look at shared hosting as fine for a small business crud (create read update delete) app. However to get all the frills, you will probably need either dedicated hosting, or something like digital ocean.

Just my opinion. Does your hosting company have dedicated hosting, where you are in full control.

marcosdipaolo's avatar

Thanks for your answer. But since some people appeare to have found the solution in shared hostings i expect people to leave answers about how to deal with this in shared hostings as well

jlrdw's avatar

if you already know some people have worked it out, why didn't you just search laravel for some past answers. All you have to do it's punch into Google.

site:laracasts.com proc_open on shared hosting

Change search term as needed.

Explanation the Google search is more powerful than the search here.

marcosdipaolo's avatar
marcosdipaolo
OP
Best Answer
Level 4

Ok, i might have found a possible solution. Pointing the cron to a file, and in that file copying the artisan file's code, but instead the :

$status = $kernel->handle(
    $input = new Symfony\Component\Console\Input\ArgvInput,
    new Symfony\Component\Console\Output\ConsoleOutput
);

you just replace the Symfony\Component\Console\Input\ArgvInput for an Symfony\Component\Console\Input\ArrayInput class passing an array to it with the key command and the command's signature as value:

#!/usr/bin/env php
<?php

define('LARAVEL_START', microtime(true));

require __DIR__.'/vendor/autoload.php';

$app = require_once __DIR__.'/bootstrap/app.php';

$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);

$status = $kernel->handle(
    $input = new Symfony\Component\Console\Input\ArrayInput([
		 'command' => 'test:log'
	]),
    new Symfony\Component\Console\Output\ConsoleOutput
);

$kernel->terminate($input, $status);

exit($status);

I guess you need to do this for every command, defining periodicty at cPanel. In case you have 2 commands with the same periodicity you might be able to pass it as an array of commands, but i'm not certain about that.

Hope this helps someone

Please or to participate in this conversation.