美文网首页
laravel 定时任务在liunx服务器上执行

laravel 定时任务在liunx服务器上执行

作者: 曦曦_6d30 | 来源:发表于2018-05-22 16:32 被阅读0次

    今天要在服务器上执行写好在laravel的定时文件

    命令  crontab -e

    添加  * * * * * php  /项目路径/artisan schedule:run

    我在定时任务里写上一条

    file_put_contents('0522.txt' , var_export('99999' , true), FILE_APPEND);

    一分钟过去了  根目录下并没有这个txt

    于是我在项目下执行  php artisan schedule:run

    出现错误

    *[Symfony\Component\Process\Exception\RuntimeException] 

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

    cd /usr/local/php/etc

    vim php.ini并搜索disable_functions指令

    disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server

    找到proc_open并删除

    重启 

    继续 php artisan schedule:run

    出现类似上面的错误 不过换成了 proc_get_status

    删除

    重启

    执行成功

    相关文章

      网友评论

          本文标题:laravel 定时任务在liunx服务器上执行

          本文链接:https://www.haomeiwen.com/subject/pfqkjftx.html