Laravel 5.2:Process 类依赖于 proc_open,这在您的 PHP 安装中不可用 [英] Laravel 5.2: The Process class relies on proc_open, which is not available on your PHP installation

查看:24
本文介绍了Laravel 5.2:Process 类依赖于 proc_open,这在您的 PHP 安装中不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 cron 作业使用 laravel 任务调度来做一些 CRUD 操作.在 localhost 和我的 Share-Hosting 服务器上,它工作了好几个月,直到最近我在我的 Share-Hosting 服务器上运行 cron 作业时不断收到此错误.我没有对共享托管服务器上的代码进行任何更改.

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 'SymfonyComponentProcessExceptionRuntimeException' 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. 联系我的托管公司删除 proc_open 表单禁用 PHP 功能.
  2. 托管公司提供了自定义 php.ini 文件.我删除了所有 disable_functions
  3. 共享托管服务器已重新启动并清除缓存

这些都没有解决问题.我不确定接下来要尝试什么,因为同一个项目在不同的共享托管服务器上运行良好.

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.

推荐答案

经过数周的尝试解决此错误.以下修复有效

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

  1. 将项目从 Laravel 5.2 升级到 5.4
  2. 在 CPanel 上使用选择 PHP 版本"将 PHP 版本设置为 7
  3. 或者在 CPanel 上使用MultiPHP Manager"将 PHP 版本设置为 ea-php70

现在,cron 作业运行顺利.我希望这对某人有所帮助.

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

这篇关于Laravel 5.2:Process 类依赖于 proc_open,这在您的 PHP 安装中不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆