Search code examples
phplaravelcroncpanel

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


I use cron job to do some CRUD operation using laravel Task Scheduling. On localhost and on my Share-Hosting server it worked fine for months until recently I keep getting this error when I run cron job on my Share-Hosting server. I did not make any changes to the code on my Share-Hosting server.

[2017-07-14 09:16:02] production.ERROR: exception 'Symfony\Component\Process\Exception\RuntimeException' with message 'The Process class relies on proc_open, which is not available on your PHP installation.' in /home/xxx/xx/vendor/symfony/process/Process.php:144
Stack trace:

But on localhost it works fine. Based on my finding online I have tried the following.

  1. Contacted my hosting company to remove proc_open form disable PHP functions.
  2. Hosting company provided custom php.ini file. I remove all disable_functions
  3. Share-Hosting Server was restarted and cache was cleared

None of this fixed the issue. I am not sure of what next to try because the same project works fine on different Share-Hosting Server.


Solution

  • After many weeks of trying to resolve this error. The following fixes worked

    1. Upgrade project from Laravel 5.2 to 5.4
    2. On CPanel using "Select Php version" set PHP version to 7
    3. Or on CPanel using "MultiPHP Manager" set PHP version to ea-php70

    Now, cron job runs smoothly. I hope this helps someone.