Home  >  Article  >  Backend Development  >  php创设OpenOffice com组件失败~

php创设OpenOffice com组件失败~

WBOY
WBOYOriginal
2016-06-13 12:10:161285browse

php创建OpenOffice com组件失败~~
1、win7下安装完openoffice 3.4.1  
2、命令行启动:soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
3、查看任务管理器:
      
      说明服务成功启动;但是以用户dell运行的,dell是我电脑上的管理员账号
4、php代码:
      

<br />   $osm = new COM("com.sun.star.ServiceManager") or die("Please be sure that OpenOffice.org is installed.n");<br />

      这一句之前是好的,突然哪一天就不好使了。
     运行这句后,出现错误:
     Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `com.sun.star.ServiceManager' in E:\work\test\test.php on line 10<br />( ! ) com_exception: in E:\work\test\test.php on line 10

此时查看任务管理器:
    
  说明new 这个com是成功的,但不是以dell用户启动的,而是以system用户启动的。
代码执行一段时间后,便会出现以上错误。

疑问之处:
 1、为什么之前是好的?会不会由于软件冲突或用户组冲突引起的调用com组件无权限?
 2、各位有没有遇到过这种情况?该如何解决?

请解惑!!
------解决思路----------------------
你考虑到是否是没有权限呢?
php 可是匿名用户啊

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn