问题描述
我使用cron作业使用laravel Task Scheduling进行一些CRUD操作.在本地主机和共享托管服务器上,它可以正常工作数月,直到最近在共享托管服务器上运行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 '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:
但是在localhost上可以正常工作.根据我在网上的发现,我尝试了以下方法.
But on localhost it works fine. Based on my finding online I have tried the following.
- 联系我的托管公司以删除proc_open表格以禁用PHP功能.
- 托管公司提供了自定义php.ini文件.我删除了所有disable_functions
- Share-Hosting Server已重新启动,并且缓存已清除
这些都不能解决问题.我不确定下一步该怎么做,因为同一项目可以在不同的Share-Hosting Server上正常工作.
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
- 将项目从Laravel 5.2升级到5.4
- 在使用选择PHP版本"的CPanel上,将 PHP版本设置为7
- 或者在CPanel上使用"MultiPHP Manager"将PHP版本设置为 ea-php70
- Upgrade project from Laravel 5.2 to 5.4
- On CPanel using "Select Php version" set PHP version to 7
- Or on CPanel using "MultiPHP Manager" set PHP version to ea-php70
现在,cron作业运行顺利.我希望这对某人有帮助.
Now, cron job runs smoothly. I hope this helps someone.
这篇关于Laravel 5.2:Process类依赖于proc_open,这在您的PHP安装中不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!