dslijian2015 2012-04-25 14:12
浏览 24
已采纳

PHP:在计划任务中未创建COM对象(而是挂起)

I have a PHP script that runs a process to generate letters on a Windows server. The file is current set up as a Scheduled Task.

In the script, the COM object is instantiated to work with the appropriate files. When it is run as a Scheduled Task, the line to instantiate the COM object does nothing and hangs the script (rather than returning any result). The script will never terminate.

$this->word = new COM("word.application");

I believe that there is no issue with the script itself, as I can run the batch file directly (with no issue). This problem only seems to come up when we try to automate it.

I think there is some permissions issue going on, but I'm not entirely sure.

Thanks for any help!

Edit:

More information about the system:

Windows 2008 Server Standard without HyperV Microsoft Office Word 2007 PHP 5.3.10 Attempting to Automate

  • 写回答

1条回答 默认 最新

  • dongmeiba6151 2012-04-26 21:58
    关注

    I have found the solution. It was a profile issue.

    In:

    C:\Windows\SysWOW64\config\systemprofile
    

    check to see if the Desktop folder exists.

    If it doesn't, create it.

    It has this issue because it is expecting the folder, but hangs when it can't find it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看