duanliaoyu8419 2011-11-21 15:45
浏览 61

PHP CLI重定向到日志后台操作

I'm getting my butt kicked by this.

I am trying to background execution of a PHP script. Of course, I want the output sent to a log file. I've done this many times in the past, yet I can't get it to work this time.

Command Line Operation without Backgrounding works perfectly:

/app/lca/scripts/create_ss7auto_order.php --process_limit 23 --ss7auto_order_number X --audits_id 53 --clli X --login XXXXXXXX --larg_cnarg cnarg --abbr X >> /tmp/create_order.log

If I try to background the command, the script seems to fail immediately. Instead of taking a while to process, it returns immediately, the backend systems that would receive triggers from this script see nothing and nothing is written to the log file:

/app/lca/scripts/create_ss7auto_order.php --process_limit 23 --ss7auto_order_number X --audits_id 53 --clli X --login XXXXXXXX --larg_cnarg cnarg --abbr X >> /tmp/create_order.log  2>&1 &

Does anyone have an idea what I am doing wrong here?

  • 写回答

1条回答 默认 最新

  • dongqiu7365 2011-11-21 16:06
    关注

    Could you try running it in a subshell like this

    (/app/lca/scripts/create_ss7auto_order.php --process_limit 23 --ss7auto_order_number X --audits_id 53 --clli X --login XXXXXXXX --larg_cnarg cnarg --abbr X >> /tmp/create_order.log  2>&1) &
    
    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测